wizz-method 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +9 -9
- package/README.md +4 -4
- package/build/artifacts/llms-full.txt +218 -218
- package/build/artifacts/llms.txt +4 -4
- package/build/site/explanation/advanced-elicitation/index.html +2 -2
- package/build/site/explanation/adversarial-review/index.html +2 -2
- package/build/site/explanation/analysis-phase/index.html +2 -2
- package/build/site/explanation/brainstorming/index.html +2 -2
- package/build/site/explanation/checkpoint-preview/index.html +2 -2
- package/build/site/explanation/established-projects-faq/index.html +2 -2
- package/build/site/explanation/forensic-investigation/index.html +2 -2
- package/build/site/explanation/named-agents/index.html +6 -6
- package/build/site/explanation/party-mode/index.html +3 -3
- package/build/site/explanation/preventing-agent-conflicts/index.html +2 -2
- package/build/site/explanation/project-context/index.html +2 -2
- package/build/site/explanation/quick-dev/index.html +2 -2
- package/build/site/explanation/web-bundles/index.html +2 -2
- package/build/site/explanation/why-solutioning-matters/index.html +2 -2
- package/build/site/how-to/{customize-bmad → customize-wizz}/index.html +6 -6
- package/build/site/how-to/established-projects/index.html +2 -2
- package/build/site/how-to/{expand-bmad-for-your-org → expand-wizz-for-your-org}/index.html +7 -7
- package/build/site/how-to/{get-answers-about-bmad → get-answers-about-wizz}/index.html +3 -3
- package/build/site/how-to/install-custom-modules/index.html +3 -3
- package/build/site/how-to/{install-bmad → install-wizz}/index.html +6 -6
- package/build/site/how-to/non-interactive-installation/index.html +3 -3
- package/build/site/how-to/project-context/index.html +2 -2
- package/build/site/how-to/quick-fixes/index.html +2 -2
- package/build/site/how-to/shard-large-documents/index.html +2 -2
- package/build/site/how-to/upgrade-to-v6/index.html +8 -8
- package/build/site/how-to/use-web-bundles/index.html +2 -2
- package/build/site/index.html +3 -3
- package/build/site/llms-full.txt +218 -218
- package/build/site/llms.txt +4 -4
- package/build/site/pagefind/fragment/en_296ddb9.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_583316f.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_67825a4.pf_fragment +0 -0
- package/build/site/pagefind/fragment/{en_41cab15.pf_fragment → en_887ce56.pf_fragment} +0 -0
- package/build/site/pagefind/fragment/en_92d7cc7.pf_fragment +0 -0
- package/build/site/pagefind/fragment/{en_56b1635.pf_fragment → en_9b57d7d.pf_fragment} +0 -0
- package/build/site/pagefind/fragment/en_ba9fb37.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_bfc56b6.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_c6d9e48.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_cdd885c.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_d890205.pf_fragment +0 -0
- package/build/site/pagefind/index/en_5b9d8c6.pf_index +0 -0
- package/build/site/pagefind/index/en_868614c.pf_index +0 -0
- package/build/site/pagefind/index/en_e4f9bff.pf_index +0 -0
- package/build/site/pagefind/pagefind-entry.json +1 -1
- package/build/site/pagefind/pagefind.en_4e69d7f053.pf_meta +0 -0
- package/build/site/reference/agents/index.html +2 -2
- package/build/site/reference/commands/index.html +3 -3
- package/build/site/reference/core-tools/index.html +3 -3
- package/build/site/reference/modules/index.html +4 -4
- package/build/site/reference/testing/index.html +2 -2
- package/build/site/reference/workflow-map/index.html +2 -2
- package/build/site/roadmap/index.html +2 -2
- package/build/site/sitemap-0.xml +1 -1
- package/build/site/tutorials/getting-started/index.html +4 -4
- package/build/site/workflow-map-diagram-fr.html +2 -2
- package/package.json +11 -9
- package/removals.txt +46 -46
- package/skills-registry.yaml +318 -0
- package/src/bmm-skills/1-analysis/research/wizz-domain-research/customize.toml +1 -1
- package/src/bmm-skills/1-analysis/research/wizz-market-research/customize.toml +1 -1
- package/src/bmm-skills/1-analysis/research/wizz-technical-research/customize.toml +2 -1
- package/src/bmm-skills/1-analysis/wizz-agent-analyst/customize.toml +2 -2
- package/src/bmm-skills/1-analysis/wizz-agent-tech-writer/customize.toml +2 -2
- package/src/bmm-skills/1-analysis/wizz-document-project/customize.toml +1 -1
- package/src/bmm-skills/1-analysis/wizz-document-project/templates/index-template.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-document-project/templates/project-overview-template.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-document-project/templates/source-tree-template.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-prfaq/customize.toml +1 -1
- package/src/bmm-skills/1-analysis/wizz-product-brief/SKILL.md +1 -1
- package/src/bmm-skills/1-analysis/wizz-product-brief/customize.toml +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-agent-pm/customize.toml +2 -2
- package/src/bmm-skills/2-plan-workflows/wizz-agent-ux-designer/customize.toml +2 -2
- package/src/bmm-skills/2-plan-workflows/wizz-create-prd/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-create-prd/customize.toml +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-edit-prd/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-edit-prd/customize.toml +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-prd/SKILL.md +3 -3
- package/src/bmm-skills/2-plan-workflows/wizz-prd/customize.toml +2 -2
- package/src/bmm-skills/2-plan-workflows/wizz-ux/SKILL.md +2 -2
- package/src/bmm-skills/2-plan-workflows/wizz-validate-prd/SKILL.md +1 -1
- package/src/bmm-skills/2-plan-workflows/wizz-validate-prd/customize.toml +1 -1
- package/src/bmm-skills/3-solutioning/wizz-agent-architect/customize.toml +2 -2
- package/src/bmm-skills/3-solutioning/wizz-architecture/SKILL.md +2 -2
- package/src/bmm-skills/3-solutioning/wizz-architecture/customize.toml +4 -2
- package/src/bmm-skills/3-solutioning/wizz-check-implementation-readiness/customize.toml +1 -1
- package/src/bmm-skills/3-solutioning/wizz-create-architecture/SKILL.md +1 -1
- package/src/bmm-skills/3-solutioning/wizz-create-architecture/customize.toml +1 -1
- package/src/bmm-skills/3-solutioning/wizz-create-epics-and-stories/customize.toml +1 -1
- package/src/bmm-skills/3-solutioning/wizz-generate-project-context/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-agent-dev/customize.toml +3 -2
- package/src/bmm-skills/4-implementation/wizz-checkpoint-preview/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-code-review/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-correct-course/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-create-story/SKILL.md +2 -2
- package/src/bmm-skills/4-implementation/wizz-create-story/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-dev-story/SKILL.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-dev-story/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-investigate/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-qa-generate-e2e-tests/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-quick-dev/SKILL.md +7 -0
- package/src/bmm-skills/4-implementation/wizz-quick-dev/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-quick-dev/step-01-clarify-and-route.md +1 -1
- package/src/bmm-skills/4-implementation/wizz-retrospective/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-sprint-planning/customize.toml +1 -1
- package/src/bmm-skills/4-implementation/wizz-sprint-status/SKILL.md +5 -5
- package/src/bmm-skills/4-implementation/wizz-sprint-status/customize.toml +1 -1
- package/src/bmm-skills/module-help.csv +32 -32
- package/src/bmm-skills/module.yaml +1 -1
- package/src/core-skills/module-help.csv +3 -3
- package/src/core-skills/module.yaml +4 -4
- package/src/core-skills/wizz-brainstorming/SKILL.md +1 -1
- package/src/core-skills/wizz-brainstorming/analysis/catalog-analysis.md +4 -4
- package/src/core-skills/wizz-brainstorming/assets/brain-selector.html +5 -5
- package/src/core-skills/wizz-brainstorming/customize.toml +1 -1
- package/src/core-skills/wizz-brainstorming/references/finalize.md +1 -1
- package/src/core-skills/wizz-brainstorming/scripts/brain.py +5 -5
- package/src/core-skills/wizz-brainstorming/scripts/tests/test_brain.py +1 -1
- package/src/core-skills/wizz-brainstorming/scripts/tests/test_memlog.py +3 -3
- package/src/core-skills/wizz-customize/SKILL.md +6 -6
- package/src/core-skills/wizz-customize/scripts/list_customizable_skills.py +3 -3
- package/src/core-skills/wizz-customize/scripts/tests/test_list_customizable_skills.py +13 -13
- package/src/core-skills/wizz-editorial-review-prose/SKILL.md +20 -45
- package/src/core-skills/wizz-editorial-review-structure/SKILL.md +1 -1
- package/src/core-skills/wizz-help/SKILL.md +3 -3
- package/src/core-skills/wizz-party-mode/SKILL.md +5 -3
- package/src/core-skills/wizz-party-mode/customize.toml +896 -2
- package/src/core-skills/wizz-party-mode/scripts/__pycache__/resolve_party.cpython-314.pyc +0 -0
- package/src/core-skills/wizz-party-mode/scripts/resolve_party.py +2 -2
- package/src/core-skills/wizz-party-mode/scripts/tests/test-resolve_party.py +1 -1
- package/src/core-skills/wizz-review-adversarial-general/SKILL.md +23 -12
- package/src/core-skills/wizz-spec/SKILL.md +3 -3
- package/src/core-skills/wizz-spec/customize.toml +2 -2
- package/src/modules/wizz/README.md +5 -5
- package/src/modules/wizz/agents/wizz-ads/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-copy/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-designer/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-growth/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-maestro/SKILL.md +48 -24
- package/src/modules/wizz/agents/wizz-memoria/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-qa/SKILL.md +1 -1
- package/src/modules/wizz/agents/wizz-seo/SKILL.md +1 -1
- package/src/modules/wizz/overrides/{bmad-agent-analyst.toml → wizz-agent-analyst.toml} +1 -1
- package/src/modules/wizz/overrides/{bmad-agent-architect.toml → wizz-agent-architect.toml} +1 -1
- package/src/modules/wizz/overrides/{bmad-agent-dev.toml → wizz-agent-dev.toml} +1 -1
- package/src/modules/wizz/overrides/{bmad-agent-pm.toml → wizz-agent-pm.toml} +1 -1
- package/src/modules/wizz/overrides/{bmad-agent-tech-writer.toml → wizz-agent-tech-writer.toml} +1 -1
- package/src/modules/wizz/overrides/{bmad-agent-ux-designer.toml → wizz-agent-ux-designer.toml} +1 -1
- package/src/modules/wizz/scripts/wizz-init.mjs +7 -7
- package/src/scripts/resolve_config.py +7 -7
- package/src/scripts/resolve_customization.py +2 -2
- package/src/scripts/tests/test_memlog.py +1 -1
- package/src/skills-lib/ab-test-setup/SKILL.md +266 -0
- package/src/skills-lib/ab-test-setup/evals/evals.json +105 -0
- package/src/skills-lib/ab-test-setup/references/sample-size-guide.md +263 -0
- package/src/skills-lib/ab-test-setup/references/test-templates.md +277 -0
- package/src/skills-lib/ad-creative/SKILL.md +362 -0
- package/src/skills-lib/ad-creative/evals/evals.json +90 -0
- package/src/skills-lib/ad-creative/references/generative-tools.md +637 -0
- package/src/skills-lib/ad-creative/references/platform-specs.md +213 -0
- package/src/skills-lib/adversarial-reviewer/SKILL.md +122 -0
- package/src/skills-lib/agent-browser/SKILL.md +139 -0
- package/src/skills-lib/ai-seo/SKILL.md +398 -0
- package/src/skills-lib/ai-seo/evals/evals.json +90 -0
- package/src/skills-lib/ai-seo/references/content-patterns.md +285 -0
- package/src/skills-lib/ai-seo/references/platform-ranking-factors.md +152 -0
- package/src/skills-lib/analytics-tracking/SKILL.md +309 -0
- package/src/skills-lib/analytics-tracking/evals/evals.json +90 -0
- package/src/skills-lib/analytics-tracking/references/event-library.md +260 -0
- package/src/skills-lib/analytics-tracking/references/ga4-implementation.md +300 -0
- package/src/skills-lib/analytics-tracking/references/gtm-implementation.md +390 -0
- package/src/skills-lib/auth-and-secrets/SKILL.md +82 -0
- package/src/skills-lib/caching-and-queues/SKILL.md +58 -0
- package/src/skills-lib/cerebro/SKILL.md +368 -0
- package/src/skills-lib/churn-prevention/SKILL.md +424 -0
- package/src/skills-lib/churn-prevention/evals/evals.json +93 -0
- package/src/skills-lib/churn-prevention/references/cancel-flow-patterns.md +316 -0
- package/src/skills-lib/churn-prevention/references/dunning-playbook.md +408 -0
- package/src/skills-lib/cloud-and-infra/SKILL.md +36 -0
- package/src/skills-lib/cold-email/SKILL.md +158 -0
- package/src/skills-lib/cold-email/evals/evals.json +94 -0
- package/src/skills-lib/cold-email/references/benchmarks.md +83 -0
- package/src/skills-lib/cold-email/references/follow-up-sequences.md +81 -0
- package/src/skills-lib/cold-email/references/frameworks.md +90 -0
- package/src/skills-lib/cold-email/references/personalization.md +79 -0
- package/src/skills-lib/cold-email/references/subject-lines.md +53 -0
- package/src/skills-lib/competitor-alternatives/SKILL.md +256 -0
- package/src/skills-lib/competitor-alternatives/evals/evals.json +93 -0
- package/src/skills-lib/competitor-alternatives/references/content-architecture.md +271 -0
- package/src/skills-lib/competitor-alternatives/references/templates.md +223 -0
- package/src/skills-lib/content-strategy/SKILL.md +359 -0
- package/src/skills-lib/content-strategy/evals/evals.json +90 -0
- package/src/skills-lib/copy-editing/SKILL.md +447 -0
- package/src/skills-lib/copy-editing/evals/evals.json +89 -0
- package/src/skills-lib/copy-editing/references/plain-english-alternatives.md +394 -0
- package/src/skills-lib/copywriting/SKILL.md +252 -0
- package/src/skills-lib/copywriting/evals/evals.json +111 -0
- package/src/skills-lib/copywriting/references/copy-frameworks.md +344 -0
- package/src/skills-lib/copywriting/references/natural-transitions.md +272 -0
- package/src/skills-lib/database-and-deps/SKILL.md +80 -0
- package/src/skills-lib/database-scaling/SKILL.md +44 -0
- package/src/skills-lib/decision-maker/SKILL.md +534 -0
- package/src/skills-lib/desktop-security/SKILL.md +43 -0
- package/src/skills-lib/email-sequence/SKILL.md +309 -0
- package/src/skills-lib/email-sequence/evals/evals.json +93 -0
- package/src/skills-lib/email-sequence/references/copy-guidelines.md +113 -0
- package/src/skills-lib/email-sequence/references/email-types.md +515 -0
- package/src/skills-lib/email-sequence/references/sequence-templates.md +168 -0
- package/src/skills-lib/enhance-prompt/README.md +34 -0
- package/src/skills-lib/enhance-prompt/SKILL.md +204 -0
- package/src/skills-lib/enhance-prompt/references/KEYWORDS.md +114 -0
- package/src/skills-lib/find-skills/SKILL.md +181 -0
- package/src/skills-lib/form-cro/SKILL.md +429 -0
- package/src/skills-lib/form-cro/evals/evals.json +90 -0
- package/src/skills-lib/free-tool-strategy/SKILL.md +178 -0
- package/src/skills-lib/free-tool-strategy/evals/evals.json +90 -0
- package/src/skills-lib/free-tool-strategy/references/tool-types.md +217 -0
- package/src/skills-lib/graphify/.graphify_version +1 -0
- package/src/skills-lib/graphify/SKILL.md +1217 -0
- package/src/skills-lib/huashu-design/LICENSE +21 -0
- package/src/skills-lib/huashu-design/README.en.md +309 -0
- package/src/skills-lib/huashu-design/README.md +348 -0
- package/src/skills-lib/huashu-design/SKILL.md +631 -0
- package/src/skills-lib/huashu-design/assets/android_frame.jsx +175 -0
- package/src/skills-lib/huashu-design/assets/animations.jsx +348 -0
- package/src/skills-lib/huashu-design/assets/banner.svg +198 -0
- package/src/skills-lib/huashu-design/assets/bgm-ad.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/bgm-educational-alt.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/bgm-educational.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/bgm-tech.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/bgm-tutorial-alt.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/bgm-tutorial.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/browser_window.jsx +166 -0
- package/src/skills-lib/huashu-design/assets/deck_index.html +348 -0
- package/src/skills-lib/huashu-design/assets/deck_stage.js +420 -0
- package/src/skills-lib/huashu-design/assets/design_canvas.jsx +205 -0
- package/src/skills-lib/huashu-design/assets/director-notes-samples/launch-film-30s-sample.md +1713 -0
- package/src/skills-lib/huashu-design/assets/ios_frame.jsx +192 -0
- package/src/skills-lib/huashu-design/assets/macos_window.jsx +96 -0
- package/src/skills-lib/huashu-design/assets/narration_stage.jsx +476 -0
- package/src/skills-lib/huashu-design/assets/personal-asset-index.example.json +71 -0
- package/src/skills-lib/huashu-design/assets/sfx/container/card-flip.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/container/card-snap.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/container/modal-open.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/container/stack-collapse.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/feedback/achievement.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/feedback/error-tone.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/feedback/notification-pop.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/feedback/success-chime.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/impact/brand-stamp.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/impact/drop-thud.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/impact/logo-reveal-v2.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/impact/logo-reveal.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/keyboard/delete-key.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/keyboard/enter.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/keyboard/space-tap.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/keyboard/type-fast.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/keyboard/type.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/magic/ai-process.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/magic/sparkle.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/magic/transform.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/progress/complete-done.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/progress/generate-start.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/progress/loading-tick.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/terminal/command-execute.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/terminal/cursor-blink.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/terminal/output-appear.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/transition/dissolve.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/transition/slide-in.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/transition/swipe-horizontal.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/transition/whoosh-fast.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/transition/whoosh.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/ui/click-soft.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/ui/click.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/ui/focus.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/ui/hover-subtle.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/ui/tap-finger.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/sfx/ui/toggle-on.mp3 +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/INDEX.md +115 -0
- package/src/skills-lib/huashu-design/assets/showcases/cover/cover-build.html +235 -0
- package/src/skills-lib/huashu-design/assets/showcases/cover/cover-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/cover/cover-pentagram.html +229 -0
- package/src/skills-lib/huashu-design/assets/showcases/cover/cover-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/cover/cover-takram.html +288 -0
- package/src/skills-lib/huashu-design/assets/showcases/cover/cover-takram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/infographic/infographic-build.html +503 -0
- package/src/skills-lib/huashu-design/assets/showcases/infographic/infographic-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/infographic/infographic-pentagram.html +600 -0
- package/src/skills-lib/huashu-design/assets/showcases/infographic/infographic-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/infographic/infographic-takram.html +670 -0
- package/src/skills-lib/huashu-design/assets/showcases/infographic/infographic-takram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/ppt/ppt-build.html +382 -0
- package/src/skills-lib/huashu-design/assets/showcases/ppt/ppt-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/ppt/ppt-pentagram.html +536 -0
- package/src/skills-lib/huashu-design/assets/showcases/ppt/ppt-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/ppt/ppt-takram.html +497 -0
- package/src/skills-lib/huashu-design/assets/showcases/ppt/ppt-takram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-nav/ainav-build.html +385 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-nav/ainav-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-nav/ainav-pentagram.html +422 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-nav/ainav-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-nav/ainav-takram.html +499 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-nav/ainav-takram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-writing/aiwriting-build.html +562 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-writing/aiwriting-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-writing/aiwriting-pentagram.html +548 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-writing/aiwriting-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-writing/aiwriting-takram.html +696 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-ai-writing/aiwriting-takram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-devdocs/devdocs-build.html +372 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-devdocs/devdocs-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-devdocs/devdocs-pentagram.html +460 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-devdocs/devdocs-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-devdocs/devdocs-takram.html +494 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-devdocs/devdocs-takram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-homepage/homepage-build.html +367 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-homepage/homepage-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-homepage/homepage-pentagram.html +368 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-homepage/homepage-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-homepage/homepage-takram.html +459 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-homepage/homepage-takram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-saas/saas-build.html +493 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-saas/saas-build.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-saas/saas-pentagram.html +556 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-saas/saas-pentagram.png +0 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-saas/saas-takram.html +604 -0
- package/src/skills-lib/huashu-design/assets/showcases/website-saas/saas-takram.png +0 -0
- package/src/skills-lib/huashu-design/demos/c1-ios-prototype-en.html +1145 -0
- package/src/skills-lib/huashu-design/demos/c1-ios-prototype.html +1142 -0
- package/src/skills-lib/huashu-design/demos/c2-slides-pptx-en.html +1055 -0
- package/src/skills-lib/huashu-design/demos/c2-slides-pptx.html +1055 -0
- package/src/skills-lib/huashu-design/demos/c3-motion-design-en.html +1134 -0
- package/src/skills-lib/huashu-design/demos/c3-motion-design.html +1134 -0
- package/src/skills-lib/huashu-design/demos/c4-tweaks-en.html +989 -0
- package/src/skills-lib/huashu-design/demos/c4-tweaks.html +989 -0
- package/src/skills-lib/huashu-design/demos/c5-infographic-en.html +816 -0
- package/src/skills-lib/huashu-design/demos/c5-infographic.html +813 -0
- package/src/skills-lib/huashu-design/demos/c6-expert-review-en.html +885 -0
- package/src/skills-lib/huashu-design/demos/c6-expert-review.html +894 -0
- package/src/skills-lib/huashu-design/demos/hero-animation-v10-en.html +1498 -0
- package/src/skills-lib/huashu-design/demos/md-html-narration/md-html-demo.html +615 -0
- package/src/skills-lib/huashu-design/demos/md-html-narration/script.md +69 -0
- package/src/skills-lib/huashu-design/demos/voiceover-demo/script.md +17 -0
- package/src/skills-lib/huashu-design/demos/voiceover-demo//344/273/200/344/271/210/346/230/257token.html +201 -0
- package/src/skills-lib/huashu-design/demos/w1-brand-protocol-en.html +684 -0
- package/src/skills-lib/huashu-design/demos/w1-brand-protocol.html +696 -0
- package/src/skills-lib/huashu-design/demos/w2-junior-designer-en.html +983 -0
- package/src/skills-lib/huashu-design/demos/w2-junior-designer.html +994 -0
- package/src/skills-lib/huashu-design/demos/w3-fallback-advisor-en.html +647 -0
- package/src/skills-lib/huashu-design/demos/w3-fallback-advisor.html +704 -0
- package/src/skills-lib/huashu-design/package-lock.json +846 -0
- package/src/skills-lib/huashu-design/package.json +8 -0
- package/src/skills-lib/huashu-design/references/animation-best-practices.md +506 -0
- package/src/skills-lib/huashu-design/references/animation-pitfalls.md +402 -0
- package/src/skills-lib/huashu-design/references/animations.md +249 -0
- package/src/skills-lib/huashu-design/references/apple-gallery-showcase.md +338 -0
- package/src/skills-lib/huashu-design/references/audio-design-rules.md +260 -0
- package/src/skills-lib/huashu-design/references/brand-asset-protocol.md +250 -0
- package/src/skills-lib/huashu-design/references/cinematic-patterns.md +264 -0
- package/src/skills-lib/huashu-design/references/content-guidelines.md +260 -0
- package/src/skills-lib/huashu-design/references/critique-guide.md +199 -0
- package/src/skills-lib/huashu-design/references/design-context.md +213 -0
- package/src/skills-lib/huashu-design/references/design-styles.md +370 -0
- package/src/skills-lib/huashu-design/references/editable-pptx.md +334 -0
- package/src/skills-lib/huashu-design/references/hero-animation-case-study.md +250 -0
- package/src/skills-lib/huashu-design/references/launch-film-director-notes.md +293 -0
- package/src/skills-lib/huashu-design/references/multi-perspective-parallel-case-study.md +267 -0
- package/src/skills-lib/huashu-design/references/react-setup.md +276 -0
- package/src/skills-lib/huashu-design/references/scene-templates.md +262 -0
- package/src/skills-lib/huashu-design/references/sfx-library.md +226 -0
- package/src/skills-lib/huashu-design/references/slide-decks.md +745 -0
- package/src/skills-lib/huashu-design/references/tweaks-system.md +313 -0
- package/src/skills-lib/huashu-design/references/verification.md +183 -0
- package/src/skills-lib/huashu-design/references/video-export.md +232 -0
- package/src/skills-lib/huashu-design/references/voiceover-pipeline.md +397 -0
- package/src/skills-lib/huashu-design/references/workflow.md +216 -0
- package/src/skills-lib/huashu-design/scripts/add-music.sh +108 -0
- package/src/skills-lib/huashu-design/scripts/convert-formats.sh +83 -0
- package/src/skills-lib/huashu-design/scripts/export_deck_pdf.mjs +98 -0
- package/src/skills-lib/huashu-design/scripts/export_deck_pptx.mjs +107 -0
- package/src/skills-lib/huashu-design/scripts/export_deck_stage_pdf.mjs +130 -0
- package/src/skills-lib/huashu-design/scripts/fetch_images.py +94 -0
- package/src/skills-lib/huashu-design/scripts/gen_deck_thumbs.mjs +55 -0
- package/src/skills-lib/huashu-design/scripts/html2pptx.js +1178 -0
- package/src/skills-lib/huashu-design/scripts/mix-voiceover.sh +127 -0
- package/src/skills-lib/huashu-design/scripts/narrate-pipeline.mjs +315 -0
- package/src/skills-lib/huashu-design/scripts/render-narration.sh +151 -0
- package/src/skills-lib/huashu-design/scripts/render-video-seek.js +238 -0
- package/src/skills-lib/huashu-design/scripts/render-video.js +289 -0
- package/src/skills-lib/huashu-design/scripts/tts-doubao.mjs +184 -0
- package/src/skills-lib/huashu-design/scripts/verify.py +154 -0
- package/src/skills-lib/huashu-design/test-prompts.json +38 -0
- package/src/skills-lib/humanizer/LICENSE +21 -0
- package/src/skills-lib/humanizer/README.md +145 -0
- package/src/skills-lib/humanizer/SKILL.md +474 -0
- package/src/skills-lib/humanizer/WARP.md +53 -0
- package/src/skills-lib/impeccable/SKILL.md +186 -0
- package/src/skills-lib/implementation-planner/SKILL.md +630 -0
- package/src/skills-lib/infrastructure/SKILL.md +34 -0
- package/src/skills-lib/inicio-de-projeto/SKILL.md +313 -0
- package/src/skills-lib/launch-strategy/SKILL.md +353 -0
- package/src/skills-lib/launch-strategy/evals/evals.json +91 -0
- package/src/skills-lib/marketing-ideas/SKILL.md +167 -0
- package/src/skills-lib/marketing-ideas/evals/evals.json +90 -0
- package/src/skills-lib/marketing-ideas/references/ideas-by-category.md +366 -0
- package/src/skills-lib/marketing-psychology/SKILL.md +455 -0
- package/src/skills-lib/marketing-psychology/evals/evals.json +88 -0
- package/src/skills-lib/motion-3d-director/SKILL.md +485 -0
- package/src/skills-lib/onboarding-cro/SKILL.md +220 -0
- package/src/skills-lib/onboarding-cro/evals/evals.json +92 -0
- package/src/skills-lib/onboarding-cro/references/experiments.md +258 -0
- package/src/skills-lib/page-cro/SKILL.md +182 -0
- package/src/skills-lib/page-cro/evals/evals.json +111 -0
- package/src/skills-lib/page-cro/references/experiments.md +248 -0
- package/src/skills-lib/paid-ads/SKILL.md +315 -0
- package/src/skills-lib/paid-ads/evals/evals.json +90 -0
- package/src/skills-lib/paid-ads/references/ad-copy-templates.md +207 -0
- package/src/skills-lib/paid-ads/references/audience-targeting.md +243 -0
- package/src/skills-lib/paid-ads/references/platform-setup-checklists.md +277 -0
- package/src/skills-lib/paywall-upgrade-cro/SKILL.md +227 -0
- package/src/skills-lib/paywall-upgrade-cro/evals/evals.json +93 -0
- package/src/skills-lib/paywall-upgrade-cro/references/experiments.md +164 -0
- package/src/skills-lib/popup-cro/SKILL.md +453 -0
- package/src/skills-lib/popup-cro/evals/evals.json +94 -0
- package/src/skills-lib/premium-landing-ui-researcher/SKILL.md +2090 -0
- package/src/skills-lib/pricing-strategy/SKILL.md +231 -0
- package/src/skills-lib/pricing-strategy/evals/evals.json +90 -0
- package/src/skills-lib/pricing-strategy/references/research-methods.md +152 -0
- package/src/skills-lib/pricing-strategy/references/tier-structure.md +232 -0
- package/src/skills-lib/product-marketing-context/SKILL.md +241 -0
- package/src/skills-lib/product-marketing-context/evals/evals.json +85 -0
- package/src/skills-lib/programmatic-seo/SKILL.md +238 -0
- package/src/skills-lib/programmatic-seo/evals/evals.json +94 -0
- package/src/skills-lib/programmatic-seo/references/playbooks.md +308 -0
- package/src/skills-lib/react-components/README.md +36 -0
- package/src/skills-lib/react-components/SKILL.md +51 -0
- package/src/skills-lib/react-components/examples/gold-standard-card.tsx +80 -0
- package/src/skills-lib/react-components/package-lock.json +231 -0
- package/src/skills-lib/react-components/package.json +16 -0
- package/src/skills-lib/react-components/resources/architecture-checklist.md +15 -0
- package/src/skills-lib/react-components/resources/component-template.tsx +37 -0
- package/src/skills-lib/react-components/resources/stitch-api-reference.md +14 -0
- package/src/skills-lib/react-components/resources/style-guide.json +27 -0
- package/src/skills-lib/react-components/scripts/fetch-stitch.sh +30 -0
- package/src/skills-lib/react-components/scripts/validate.js +70 -0
- package/src/skills-lib/references/premium-agency-rules.md +79 -0
- package/src/skills-lib/referral-program/SKILL.md +255 -0
- package/src/skills-lib/referral-program/evals/evals.json +89 -0
- package/src/skills-lib/referral-program/references/affiliate-programs.md +164 -0
- package/src/skills-lib/referral-program/references/program-examples.md +143 -0
- package/src/skills-lib/remotion-best-practices/SKILL.md +61 -0
- package/src/skills-lib/remotion-best-practices/rules/3d.md +86 -0
- package/src/skills-lib/remotion-best-practices/rules/animations.md +27 -0
- package/src/skills-lib/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/src/skills-lib/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/src/skills-lib/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
- package/src/skills-lib/remotion-best-practices/rules/assets.md +78 -0
- package/src/skills-lib/remotion-best-practices/rules/audio-visualization.md +198 -0
- package/src/skills-lib/remotion-best-practices/rules/audio.md +169 -0
- package/src/skills-lib/remotion-best-practices/rules/calculate-metadata.md +134 -0
- package/src/skills-lib/remotion-best-practices/rules/can-decode.md +75 -0
- package/src/skills-lib/remotion-best-practices/rules/charts.md +120 -0
- package/src/skills-lib/remotion-best-practices/rules/compositions.md +154 -0
- package/src/skills-lib/remotion-best-practices/rules/display-captions.md +184 -0
- package/src/skills-lib/remotion-best-practices/rules/extract-frames.md +229 -0
- package/src/skills-lib/remotion-best-practices/rules/ffmpeg.md +38 -0
- package/src/skills-lib/remotion-best-practices/rules/fonts.md +152 -0
- package/src/skills-lib/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/src/skills-lib/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/src/skills-lib/remotion-best-practices/rules/get-video-duration.md +60 -0
- package/src/skills-lib/remotion-best-practices/rules/gifs.md +141 -0
- package/src/skills-lib/remotion-best-practices/rules/images.md +134 -0
- package/src/skills-lib/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/src/skills-lib/remotion-best-practices/rules/light-leaks.md +73 -0
- package/src/skills-lib/remotion-best-practices/rules/lottie.md +70 -0
- package/src/skills-lib/remotion-best-practices/rules/maps.md +412 -0
- package/src/skills-lib/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/src/skills-lib/remotion-best-practices/rules/measuring-text.md +140 -0
- package/src/skills-lib/remotion-best-practices/rules/parameters.md +109 -0
- package/src/skills-lib/remotion-best-practices/rules/sequencing.md +118 -0
- package/src/skills-lib/remotion-best-practices/rules/sfx.md +26 -0
- package/src/skills-lib/remotion-best-practices/rules/subtitles.md +36 -0
- package/src/skills-lib/remotion-best-practices/rules/tailwind.md +11 -0
- package/src/skills-lib/remotion-best-practices/rules/text-animations.md +20 -0
- package/src/skills-lib/remotion-best-practices/rules/timing.md +179 -0
- package/src/skills-lib/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/src/skills-lib/remotion-best-practices/rules/transitions.md +197 -0
- package/src/skills-lib/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/src/skills-lib/remotion-best-practices/rules/trimming.md +51 -0
- package/src/skills-lib/remotion-best-practices/rules/videos.md +171 -0
- package/src/skills-lib/remotion-best-practices/rules/voiceover.md +99 -0
- package/src/skills-lib/revops/SKILL.md +343 -0
- package/src/skills-lib/revops/evals/evals.json +91 -0
- package/src/skills-lib/revops/references/automation-playbooks.md +290 -0
- package/src/skills-lib/revops/references/lifecycle-definitions.md +278 -0
- package/src/skills-lib/revops/references/routing-rules.md +203 -0
- package/src/skills-lib/revops/references/scoring-models.md +247 -0
- package/src/skills-lib/sales-enablement/SKILL.md +349 -0
- package/src/skills-lib/sales-enablement/evals/evals.json +91 -0
- package/src/skills-lib/sales-enablement/references/deck-frameworks.md +263 -0
- package/src/skills-lib/sales-enablement/references/demo-scripts.md +355 -0
- package/src/skills-lib/sales-enablement/references/objection-library.md +270 -0
- package/src/skills-lib/sales-enablement/references/one-pager-templates.md +208 -0
- package/src/skills-lib/schema-markup/SKILL.md +179 -0
- package/src/skills-lib/schema-markup/evals/evals.json +87 -0
- package/src/skills-lib/schema-markup/references/schema-examples.md +398 -0
- package/src/skills-lib/seo-audit/SKILL.md +412 -0
- package/src/skills-lib/seo-audit/evals/evals.json +136 -0
- package/src/skills-lib/seo-audit/references/ai-writing-detection.md +200 -0
- package/src/skills-lib/signup-flow-cro/SKILL.md +359 -0
- package/src/skills-lib/signup-flow-cro/evals/evals.json +88 -0
- package/src/skills-lib/site-architecture/SKILL.md +357 -0
- package/src/skills-lib/site-architecture/evals/evals.json +88 -0
- package/src/skills-lib/site-architecture/references/mermaid-templates.md +216 -0
- package/src/skills-lib/site-architecture/references/navigation-patterns.md +305 -0
- package/src/skills-lib/site-architecture/references/site-type-templates.md +293 -0
- package/src/skills-lib/social-content/SKILL.md +278 -0
- package/src/skills-lib/social-content/evals/evals.json +92 -0
- package/src/skills-lib/social-content/references/platforms.md +170 -0
- package/src/skills-lib/social-content/references/post-templates.md +177 -0
- package/src/skills-lib/social-content/references/reverse-engineering.md +195 -0
- package/src/skills-lib/supabase-postgres-best-practices/AGENTS.md +68 -0
- package/src/skills-lib/supabase-postgres-best-practices/CLAUDE.md +68 -0
- package/src/skills-lib/supabase-postgres-best-practices/README.md +116 -0
- package/src/skills-lib/supabase-postgres-best-practices/SKILL.md +64 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/_contributing.md +171 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/_sections.md +39 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/_template.md +34 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/query-index-types.md +48 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/src/skills-lib/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
- package/src/skills-lib/taste-redesign/SKILL.md +178 -0
- package/src/skills-lib/taste-skill/SKILL.md +1206 -0
- package/src/skills-lib/ui-component-curator/SKILL.md +102 -0
- package/src/skills-lib/ui-ux-pro-max/SKILL.md +377 -0
- package/src/skills-lib/ui-ux-pro-max/data/charts.csv +26 -0
- package/src/skills-lib/ui-ux-pro-max/data/colors.csv +97 -0
- package/src/skills-lib/ui-ux-pro-max/data/icons.csv +101 -0
- package/src/skills-lib/ui-ux-pro-max/data/landing.csv +31 -0
- package/src/skills-lib/ui-ux-pro-max/data/products.csv +97 -0
- package/src/skills-lib/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/src/skills-lib/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/src/skills-lib/ui-ux-pro-max/data/styles.csv +68 -0
- package/src/skills-lib/ui-ux-pro-max/data/typography.csv +58 -0
- package/src/skills-lib/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/src/skills-lib/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/src/skills-lib/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/__pycache__/search.cpython-314.pyc +0 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/core.py +253 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/graphify-out/cache/0964cef300f753b5cee0cc49777ca97035c85d45c212099405d9ee4da36e523f.json +1 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/graphify-out/cache/21a40f6810c3a6f17acc3580f106171daf78c7b41bbd066bc80448a821ea0adf.json +1 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/graphify-out/cache/69ea15a020ac81b8459e37ef63654398a50c1035fc01c43d8069df217389f7f3.json +1 -0
- package/src/skills-lib/ui-ux-pro-max/scripts/search.py +114 -0
- package/src/skills-lib/web-security/SKILL.md +147 -0
- package/src/skills-lib/wizz-router/SKILL.md +257 -0
- package/src/squads/README.md +39 -0
- package/src/squads/advisory-board/README.md +34 -0
- package/src/squads/advisory-board/agents/board-chair.md +161 -0
- package/src/squads/advisory-board/agents/brene-brown.md +296 -0
- package/src/squads/advisory-board/agents/charlie-munger.md +590 -0
- package/src/squads/advisory-board/agents/derek-sivers.md +268 -0
- package/src/squads/advisory-board/agents/naval-ravikant.md +251 -0
- package/src/squads/advisory-board/agents/patrick-lencioni.md +394 -0
- package/src/squads/advisory-board/agents/peter-thiel.md +269 -0
- package/src/squads/advisory-board/agents/ray-dalio.md +587 -0
- package/src/squads/advisory-board/agents/reid-hoffman.md +278 -0
- package/src/squads/advisory-board/agents/simon-sinek.md +291 -0
- package/src/squads/advisory-board/agents/yvon-chouinard.md +275 -0
- package/src/squads/advisory-board/squad.yaml +50 -0
- package/src/squads/brand-squad/README.md +60 -0
- package/src/squads/brand-squad/agents/al-ries.md +175 -0
- package/src/squads/brand-squad/agents/alina-wheeler.md +184 -0
- package/src/squads/brand-squad/agents/archetype-consultant.md +215 -0
- package/src/squads/brand-squad/agents/brand-chief.md +158 -0
- package/src/squads/brand-squad/agents/byron-sharp.md +169 -0
- package/src/squads/brand-squad/agents/david-aaker.md +166 -0
- package/src/squads/brand-squad/agents/denise-yohn.md +172 -0
- package/src/squads/brand-squad/agents/domain-scout.md +135 -0
- package/src/squads/brand-squad/agents/donald-miller.md +179 -0
- package/src/squads/brand-squad/agents/emily-heyward.md +147 -0
- package/src/squads/brand-squad/agents/jean-noel-kapferer.md +189 -0
- package/src/squads/brand-squad/agents/kevin-keller.md +199 -0
- package/src/squads/brand-squad/agents/marty-neumeier.md +170 -0
- package/src/squads/brand-squad/agents/miller-sticky-brand.md +180 -0
- package/src/squads/brand-squad/agents/naming-strategist.md +171 -0
- package/src/squads/brand-squad/squad.yaml +117 -0
- package/src/squads/c-level-squad/README.md +29 -0
- package/src/squads/c-level-squad/agents/caio-architect.md +235 -0
- package/src/squads/c-level-squad/agents/cio-engineer.md +209 -0
- package/src/squads/c-level-squad/agents/cmo-architect.md +208 -0
- package/src/squads/c-level-squad/agents/coo-orchestrator.md +193 -0
- package/src/squads/c-level-squad/agents/cto-architect.md +194 -0
- package/src/squads/c-level-squad/agents/vision-chief.md +201 -0
- package/src/squads/c-level-squad/squad.yaml +45 -0
- package/src/squads/claude-code-mastery/README.md +146 -0
- package/src/squads/claude-code-mastery/agents/claude-mastery-chief.md +554 -0
- package/src/squads/claude-code-mastery/agents/config-engineer.md +865 -0
- package/src/squads/claude-code-mastery/agents/hooks-architect.md +1013 -0
- package/src/squads/claude-code-mastery/agents/mcp-integrator.md +791 -0
- package/src/squads/claude-code-mastery/agents/project-integrator.md +1196 -0
- package/src/squads/claude-code-mastery/agents/roadmap-sentinel.md +931 -0
- package/src/squads/claude-code-mastery/agents/skill-craftsman.md +1250 -0
- package/src/squads/claude-code-mastery/agents/swarm-orchestrator.md +1008 -0
- package/src/squads/copy-squad/README.md +65 -0
- package/src/squads/copy-squad/agents/andre-chaperon.md +206 -0
- package/src/squads/copy-squad/agents/ben-settle.md +194 -0
- package/src/squads/copy-squad/agents/claude-hopkins.md +182 -0
- package/src/squads/copy-squad/agents/clayton-makepeace.md +225 -0
- package/src/squads/copy-squad/agents/copy-chief.md +166 -0
- package/src/squads/copy-squad/agents/dan-kennedy.md +202 -0
- package/src/squads/copy-squad/agents/dan-koe.md +223 -0
- package/src/squads/copy-squad/agents/david-deutsch.md +197 -0
- package/src/squads/copy-squad/agents/david-ogilvy.md +198 -0
- package/src/squads/copy-squad/agents/eugene-schwartz.md +238 -0
- package/src/squads/copy-squad/agents/frank-kern.md +195 -0
- package/src/squads/copy-squad/agents/gary-bencivenga.md +197 -0
- package/src/squads/copy-squad/agents/gary-halbert.md +219 -0
- package/src/squads/copy-squad/agents/jim-rutz.md +193 -0
- package/src/squads/copy-squad/agents/joe-sugarman.md +234 -0
- package/src/squads/copy-squad/agents/john-carlton.md +203 -0
- package/src/squads/copy-squad/agents/jon-benson.md +196 -0
- package/src/squads/copy-squad/agents/parris-lampropoulos.md +188 -0
- package/src/squads/copy-squad/agents/robert-collier.md +183 -0
- package/src/squads/copy-squad/agents/russell-brunson.md +229 -0
- package/src/squads/copy-squad/agents/ry-schwartz.md +185 -0
- package/src/squads/copy-squad/agents/stefan-georgi.md +188 -0
- package/src/squads/copy-squad/agents/todd-brown.md +171 -0
- package/src/squads/copy-squad/squad.yaml +87 -0
- package/src/squads/cybersecurity/README.md +38 -0
- package/src/squads/cybersecurity/agents/busterer.md +108 -0
- package/src/squads/cybersecurity/agents/cartographer.md +114 -0
- package/src/squads/cybersecurity/agents/chris-sanders.md +205 -0
- package/src/squads/cybersecurity/agents/command-generator.md +121 -0
- package/src/squads/cybersecurity/agents/cyber-chief.md +120 -0
- package/src/squads/cybersecurity/agents/dirber.md +111 -0
- package/src/squads/cybersecurity/agents/fuzzer.md +121 -0
- package/src/squads/cybersecurity/agents/georgia-weidman.md +178 -0
- package/src/squads/cybersecurity/agents/jim-manico.md +182 -0
- package/src/squads/cybersecurity/agents/marcus-carey.md +200 -0
- package/src/squads/cybersecurity/agents/omar-santos.md +206 -0
- package/src/squads/cybersecurity/agents/peter-kim.md +179 -0
- package/src/squads/cybersecurity/agents/ripper.md +121 -0
- package/src/squads/cybersecurity/agents/rogue.md +116 -0
- package/src/squads/cybersecurity/agents/shannon-runner.md +108 -0
- package/src/squads/cybersecurity/squad.yaml +56 -0
- package/src/squads/data-squad/README.md +30 -0
- package/src/squads/data-squad/agents/avinash-kaushik.md +268 -0
- package/src/squads/data-squad/agents/data-chief.md +167 -0
- package/src/squads/data-squad/agents/david-spinks.md +277 -0
- package/src/squads/data-squad/agents/nick-mehta.md +294 -0
- package/src/squads/data-squad/agents/peter-fader.md +246 -0
- package/src/squads/data-squad/agents/sean-ellis.md +303 -0
- package/src/squads/data-squad/agents/wes-kao.md +268 -0
- package/src/squads/data-squad/squad.yaml +46 -0
- package/src/squads/design-squad/README.md +31 -0
- package/src/squads/design-squad/agents/brad-frost.md +185 -0
- package/src/squads/design-squad/agents/dan-mall.md +178 -0
- package/src/squads/design-squad/agents/dave-malouf.md +198 -0
- package/src/squads/design-squad/agents/design-chief.md +109 -0
- package/src/squads/design-squad/agents/design-system-architect.md +109 -0
- package/src/squads/design-squad/agents/ui-engineer.md +102 -0
- package/src/squads/design-squad/agents/ux-designer.md +105 -0
- package/src/squads/design-squad/agents/visual-generator.md +108 -0
- package/src/squads/design-squad/squad.yaml +48 -0
- package/src/squads/hormozi-squad/README.md +39 -0
- package/src/squads/hormozi-squad/agents/hormozi-ads.md +159 -0
- package/src/squads/hormozi-squad/agents/hormozi-advisor.md +178 -0
- package/src/squads/hormozi-squad/agents/hormozi-audit.md +178 -0
- package/src/squads/hormozi-squad/agents/hormozi-chief.md +111 -0
- package/src/squads/hormozi-squad/agents/hormozi-closer.md +179 -0
- package/src/squads/hormozi-squad/agents/hormozi-content.md +166 -0
- package/src/squads/hormozi-squad/agents/hormozi-copy.md +152 -0
- package/src/squads/hormozi-squad/agents/hormozi-hooks.md +177 -0
- package/src/squads/hormozi-squad/agents/hormozi-launch.md +160 -0
- package/src/squads/hormozi-squad/agents/hormozi-leads.md +198 -0
- package/src/squads/hormozi-squad/agents/hormozi-models.md +191 -0
- package/src/squads/hormozi-squad/agents/hormozi-offers.md +197 -0
- package/src/squads/hormozi-squad/agents/hormozi-pricing.md +151 -0
- package/src/squads/hormozi-squad/agents/hormozi-retention.md +166 -0
- package/src/squads/hormozi-squad/agents/hormozi-scale.md +175 -0
- package/src/squads/hormozi-squad/agents/hormozi-workshop.md +160 -0
- package/src/squads/hormozi-squad/squad.yaml +60 -0
- package/src/squads/movement/README.md +29 -0
- package/src/squads/movement/agents/analista-de-impacto.md +350 -0
- package/src/squads/movement/agents/estrategista-de-ciclo.md +301 -0
- package/src/squads/movement/agents/fenomenologo.md +169 -0
- package/src/squads/movement/agents/identitario.md +265 -0
- package/src/squads/movement/agents/manifestador.md +279 -0
- package/src/squads/movement/agents/movement-architect.md +210 -0
- package/src/squads/movement/agents/movement-chief.md +135 -0
- package/src/squads/movement/squad.yaml +45 -0
- package/src/squads/storytelling/README.md +35 -0
- package/src/squads/storytelling/agents/blake-snyder.md +225 -0
- package/src/squads/storytelling/agents/dan-harmon.md +167 -0
- package/src/squads/storytelling/agents/joseph-campbell.md +184 -0
- package/src/squads/storytelling/agents/keith-johnstone.md +157 -0
- package/src/squads/storytelling/agents/kindra-hall.md +162 -0
- package/src/squads/storytelling/agents/marshall-ganz.md +167 -0
- package/src/squads/storytelling/agents/matthew-dicks.md +152 -0
- package/src/squads/storytelling/agents/nancy-duarte.md +154 -0
- package/src/squads/storytelling/agents/oren-klaff.md +166 -0
- package/src/squads/storytelling/agents/park-howell.md +152 -0
- package/src/squads/storytelling/agents/shawn-coyne.md +208 -0
- package/src/squads/storytelling/agents/story-chief.md +155 -0
- package/src/squads/storytelling/squad.yaml +52 -0
- package/src/squads/traffic-masters/README.md +39 -0
- package/src/squads/traffic-masters/agents/ad-midas.md +149 -0
- package/src/squads/traffic-masters/agents/ads-analyst.md +135 -0
- package/src/squads/traffic-masters/agents/creative-analyst.md +142 -0
- package/src/squads/traffic-masters/agents/depesh-mandalia.md +174 -0
- package/src/squads/traffic-masters/agents/fiscal.md +144 -0
- package/src/squads/traffic-masters/agents/kasim-aslam.md +158 -0
- package/src/squads/traffic-masters/agents/media-buyer.md +159 -0
- package/src/squads/traffic-masters/agents/molly-pittman.md +185 -0
- package/src/squads/traffic-masters/agents/nicholas-kusmich.md +157 -0
- package/src/squads/traffic-masters/agents/pedro-sobral.md +158 -0
- package/src/squads/traffic-masters/agents/performance-analyst.md +135 -0
- package/src/squads/traffic-masters/agents/pixel-specialist.md +144 -0
- package/src/squads/traffic-masters/agents/ralph-burns.md +163 -0
- package/src/squads/traffic-masters/agents/scale-optimizer.md +144 -0
- package/src/squads/traffic-masters/agents/tom-breeze.md +175 -0
- package/src/squads/traffic-masters/agents/traffic-chief.md +97 -0
- package/src/squads/traffic-masters/squad.yaml +59 -0
- package/tools/bundle-web-bundles.js +1 -1
- package/tools/format-workflow-md.js +2 -2
- package/tools/installer/commands/install.js +13 -1
- package/tools/installer/commands/status.js +9 -9
- package/tools/installer/commands/uninstall.js +5 -5
- package/tools/installer/core/config.js +20 -0
- package/tools/installer/core/existing-install.js +8 -8
- package/tools/installer/core/install-paths.js +13 -13
- package/tools/installer/core/installer.js +202 -102
- package/tools/installer/core/legacy-warnings.js +16 -16
- package/tools/installer/core/manifest-generator.js +44 -33
- package/tools/installer/core/manifest.js +30 -30
- package/tools/installer/core/python-check.js +7 -7
- package/tools/installer/ide/_config-driven.js +97 -97
- package/tools/installer/ide/manager.js +17 -17
- package/tools/installer/ide/platform-codes.yaml +5 -5
- package/tools/installer/ide/shared/installed-skills.js +13 -13
- package/tools/installer/ide/shared/path-utils.js +46 -46
- package/tools/installer/ide/shared/skill-manifest.js +4 -4
- package/tools/installer/install-messages.yaml +1 -1
- package/tools/installer/list-options.js +3 -3
- package/tools/installer/modules/channel-plan.js +1 -1
- package/tools/installer/modules/channel-resolver.js +1 -1
- package/tools/installer/modules/cli-config.js +145 -0
- package/tools/installer/modules/custom-module-manager.js +16 -16
- package/tools/installer/modules/external-manager.js +6 -6
- package/tools/installer/modules/mcp-config.js +137 -0
- package/tools/installer/modules/official-modules.js +42 -42
- package/tools/installer/modules/plugin-resolver.js +3 -3
- package/tools/installer/modules/skills-lib.js +135 -0
- package/tools/installer/project-root.js +13 -13
- package/tools/installer/prompts.js +1 -1
- package/tools/installer/set-overrides.js +6 -6
- package/tools/installer/ui.js +239 -29
- package/tools/installer/yaml-format.js +1 -1
- package/tools/migrate-custom-module-paths.js +11 -11
- package/tools/skill-validator.md +6 -6
- package/tools/validate-skills.js +10 -5
- package/web-bundles/README.md +4 -4
- package/web-bundles/brainstorming-coach/INSTRUCTIONS.md +1 -1
- package/web-bundles/bundles.json +6 -6
- package/web-bundles/market-and-industry-research/INSTRUCTIONS.md +1 -1
- package/web-bundles/prd-coach/INSTRUCTIONS.md +3 -3
- package/web-bundles/prfaq-coach/INSTRUCTIONS.md +3 -3
- package/web-bundles/product-brief-coach/INSTRUCTIONS.md +3 -3
- package/web-bundles/ux-coach/INSTRUCTIONS.md +1 -1
- package/{bmad-modules.yaml → wizz-modules.yaml} +15 -15
- package/build/site/pagefind/fragment/en_5ad92a9.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_7aea5bc.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_81bcd7f.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_938e9c4.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_b51d75b.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_c9fea21.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_e07e982.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_f4389af.pf_fragment +0 -0
- package/build/site/pagefind/fragment/en_f52c9f9.pf_fragment +0 -0
- package/build/site/pagefind/index/en_82c64dc.pf_index +0 -0
- package/build/site/pagefind/index/en_d0dd3c7.pf_index +0 -0
- package/build/site/pagefind/index/en_e890f88.pf_index +0 -0
- package/build/site/pagefind/pagefind.en_ee1b8a17c8.pf_meta +0 -0
- /package/build/site/img/{bmad-dark.png → wizz-dark.png} +0 -0
- /package/build/site/img/{bmad-light.png → wizz-light.png} +0 -0
- /package/src/bmm-skills/1-analysis/wizz-prfaq/{bmad-manifest.json → wizz-manifest.json} +0 -0
- /package/tools/installer/{bmad-cli.js → wizz-cli.js} +0 -0
|
@@ -0,0 +1,1178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* html2pptx - Convert HTML slide to pptxgenjs slide with positioned elements
|
|
3
|
+
*
|
|
4
|
+
* USAGE:
|
|
5
|
+
* const pptx = new pptxgen();
|
|
6
|
+
* pptx.layout = 'LAYOUT_16x9'; // Must match HTML body dimensions
|
|
7
|
+
*
|
|
8
|
+
* const { slide, placeholders } = await html2pptx('slide.html', pptx);
|
|
9
|
+
* slide.addChart(pptx.charts.LINE, data, placeholders[0]);
|
|
10
|
+
*
|
|
11
|
+
* await pptx.writeFile('output.pptx');
|
|
12
|
+
*
|
|
13
|
+
* FEATURES:
|
|
14
|
+
* - Converts HTML to PowerPoint with accurate positioning
|
|
15
|
+
* - Supports text, images, shapes, and bullet lists
|
|
16
|
+
* - Extracts placeholder elements (class="placeholder") with positions
|
|
17
|
+
* - Handles CSS gradients, borders, and margins
|
|
18
|
+
*
|
|
19
|
+
* VALIDATION:
|
|
20
|
+
* - Uses body width/height from HTML for viewport sizing
|
|
21
|
+
* - Throws error if HTML dimensions don't match presentation layout
|
|
22
|
+
* - Throws error if content overflows body (with overflow details)
|
|
23
|
+
*
|
|
24
|
+
* RETURNS:
|
|
25
|
+
* { slide, placeholders } where placeholders is an array of { id, x, y, w, h }
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
const { chromium } = require('playwright');
|
|
29
|
+
const path = require('path');
|
|
30
|
+
const sharp = require('sharp');
|
|
31
|
+
|
|
32
|
+
const PT_PER_PX = 0.75;
|
|
33
|
+
const PX_PER_IN = 96;
|
|
34
|
+
const EMU_PER_IN = 914400;
|
|
35
|
+
|
|
36
|
+
// Helper: Get body dimensions and check for overflow
|
|
37
|
+
async function getBodyDimensions(page) {
|
|
38
|
+
const bodyDimensions = await page.evaluate(() => {
|
|
39
|
+
const body = document.body;
|
|
40
|
+
const style = window.getComputedStyle(body);
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
width: parseFloat(style.width),
|
|
44
|
+
height: parseFloat(style.height),
|
|
45
|
+
scrollWidth: body.scrollWidth,
|
|
46
|
+
scrollHeight: body.scrollHeight
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const errors = [];
|
|
51
|
+
const widthOverflowPx = Math.max(0, bodyDimensions.scrollWidth - bodyDimensions.width - 1);
|
|
52
|
+
const heightOverflowPx = Math.max(0, bodyDimensions.scrollHeight - bodyDimensions.height - 1);
|
|
53
|
+
|
|
54
|
+
const widthOverflowPt = widthOverflowPx * PT_PER_PX;
|
|
55
|
+
const heightOverflowPt = heightOverflowPx * PT_PER_PX;
|
|
56
|
+
|
|
57
|
+
if (widthOverflowPt > 0 || heightOverflowPt > 0) {
|
|
58
|
+
const directions = [];
|
|
59
|
+
if (widthOverflowPt > 0) directions.push(`${widthOverflowPt.toFixed(1)}pt horizontally`);
|
|
60
|
+
if (heightOverflowPt > 0) directions.push(`${heightOverflowPt.toFixed(1)}pt vertically`);
|
|
61
|
+
const reminder = heightOverflowPt > 0 ? ' (Remember: leave 0.5" margin at bottom of slide)' : '';
|
|
62
|
+
errors.push(`HTML content overflows body by ${directions.join(' and ')}${reminder}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return { ...bodyDimensions, errors };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Helper: Validate dimensions match presentation layout
|
|
69
|
+
function validateDimensions(bodyDimensions, pres) {
|
|
70
|
+
const errors = [];
|
|
71
|
+
const widthInches = bodyDimensions.width / PX_PER_IN;
|
|
72
|
+
const heightInches = bodyDimensions.height / PX_PER_IN;
|
|
73
|
+
|
|
74
|
+
if (pres.presLayout) {
|
|
75
|
+
const layoutWidth = pres.presLayout.width / EMU_PER_IN;
|
|
76
|
+
const layoutHeight = pres.presLayout.height / EMU_PER_IN;
|
|
77
|
+
|
|
78
|
+
if (Math.abs(layoutWidth - widthInches) > 0.1 || Math.abs(layoutHeight - heightInches) > 0.1) {
|
|
79
|
+
errors.push(
|
|
80
|
+
`HTML dimensions (${widthInches.toFixed(1)}" × ${heightInches.toFixed(1)}") ` +
|
|
81
|
+
`don't match presentation layout (${layoutWidth.toFixed(1)}" × ${layoutHeight.toFixed(1)}")`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return errors;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function validateTextBoxPosition(slideData, bodyDimensions) {
|
|
89
|
+
const errors = [];
|
|
90
|
+
const slideHeightInches = bodyDimensions.height / PX_PER_IN;
|
|
91
|
+
const minBottomMargin = 0.5; // 0.5 inches from bottom
|
|
92
|
+
|
|
93
|
+
for (const el of slideData.elements) {
|
|
94
|
+
// Check text elements (p, h1-h6, list, merged-text)
|
|
95
|
+
if (['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'list', 'merged-text'].includes(el.type)) {
|
|
96
|
+
const fontSize = el.style?.fontSize || 0;
|
|
97
|
+
const bottomEdge = el.position.y + el.position.h;
|
|
98
|
+
const distanceFromBottom = slideHeightInches - bottomEdge;
|
|
99
|
+
|
|
100
|
+
if (fontSize > 12 && distanceFromBottom < minBottomMargin) {
|
|
101
|
+
const getText = () => {
|
|
102
|
+
if (typeof el.text === 'string') return el.text;
|
|
103
|
+
if (Array.isArray(el.text)) return el.text.find(t => t.text)?.text || '';
|
|
104
|
+
if (Array.isArray(el.items)) return el.items.find(item => item.text)?.text || '';
|
|
105
|
+
return '';
|
|
106
|
+
};
|
|
107
|
+
const textPrefix = getText().substring(0, 50) + (getText().length > 50 ? '...' : '');
|
|
108
|
+
|
|
109
|
+
errors.push(
|
|
110
|
+
`Text box "${textPrefix}" ends too close to bottom edge ` +
|
|
111
|
+
`(${distanceFromBottom.toFixed(2)}" from bottom, minimum ${minBottomMargin}" required)`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return errors;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Helper: Add background to slide
|
|
121
|
+
async function addBackground(slideData, targetSlide, tmpDir) {
|
|
122
|
+
if (slideData.background.type === 'image' && slideData.background.path) {
|
|
123
|
+
let imagePath = slideData.background.path.startsWith('file://')
|
|
124
|
+
? slideData.background.path.replace('file://', '')
|
|
125
|
+
: slideData.background.path;
|
|
126
|
+
targetSlide.background = { path: imagePath };
|
|
127
|
+
} else if (slideData.background.type === 'color' && slideData.background.value) {
|
|
128
|
+
targetSlide.background = { color: slideData.background.value };
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Helper: Add elements to slide
|
|
133
|
+
function addElements(slideData, targetSlide, pres) {
|
|
134
|
+
for (const el of slideData.elements) {
|
|
135
|
+
if (el.type === 'image') {
|
|
136
|
+
let imagePath = el.src.startsWith('file://') ? el.src.replace('file://', '') : el.src;
|
|
137
|
+
targetSlide.addImage({
|
|
138
|
+
path: imagePath,
|
|
139
|
+
x: el.position.x,
|
|
140
|
+
y: el.position.y,
|
|
141
|
+
w: el.position.w,
|
|
142
|
+
h: el.position.h
|
|
143
|
+
});
|
|
144
|
+
} else if (el.type === 'line') {
|
|
145
|
+
targetSlide.addShape(pres.ShapeType.line, {
|
|
146
|
+
x: el.x1,
|
|
147
|
+
y: el.y1,
|
|
148
|
+
w: el.x2 - el.x1,
|
|
149
|
+
h: el.y2 - el.y1,
|
|
150
|
+
line: { color: el.color, width: el.width }
|
|
151
|
+
});
|
|
152
|
+
} else if (el.type === 'shape') {
|
|
153
|
+
const shapeOptions = {
|
|
154
|
+
x: el.position.x,
|
|
155
|
+
y: el.position.y,
|
|
156
|
+
w: el.position.w,
|
|
157
|
+
h: el.position.h,
|
|
158
|
+
shape: el.shape.rectRadius > 0 ? pres.ShapeType.roundRect : pres.ShapeType.rect
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
if (el.shape.fill) {
|
|
162
|
+
shapeOptions.fill = { color: el.shape.fill };
|
|
163
|
+
if (el.shape.transparency != null) shapeOptions.fill.transparency = el.shape.transparency;
|
|
164
|
+
}
|
|
165
|
+
if (el.shape.line) shapeOptions.line = el.shape.line;
|
|
166
|
+
if (el.shape.rectRadius > 0) shapeOptions.rectRadius = el.shape.rectRadius;
|
|
167
|
+
if (el.shape.shadow) shapeOptions.shadow = el.shape.shadow;
|
|
168
|
+
|
|
169
|
+
targetSlide.addText(el.text || '', shapeOptions);
|
|
170
|
+
} else if (el.type === 'list') {
|
|
171
|
+
const listOptions = {
|
|
172
|
+
x: el.position.x,
|
|
173
|
+
y: el.position.y,
|
|
174
|
+
w: el.position.w,
|
|
175
|
+
h: el.position.h,
|
|
176
|
+
fontSize: el.style.fontSize,
|
|
177
|
+
fontFace: el.style.fontFace,
|
|
178
|
+
color: el.style.color,
|
|
179
|
+
align: el.style.align,
|
|
180
|
+
valign: 'top',
|
|
181
|
+
lineSpacing: el.style.lineSpacing,
|
|
182
|
+
paraSpaceBefore: el.style.paraSpaceBefore,
|
|
183
|
+
paraSpaceAfter: el.style.paraSpaceAfter,
|
|
184
|
+
margin: el.style.margin
|
|
185
|
+
};
|
|
186
|
+
if (el.style.margin) listOptions.margin = el.style.margin;
|
|
187
|
+
targetSlide.addText(el.items, listOptions);
|
|
188
|
+
} else if (el.type === 'merged-text') {
|
|
189
|
+
// data-pptx-merge container — all paragraphs in one editable text frame.
|
|
190
|
+
const mergedOptions = {
|
|
191
|
+
x: el.position.x,
|
|
192
|
+
y: el.position.y,
|
|
193
|
+
w: el.position.w,
|
|
194
|
+
h: el.position.h,
|
|
195
|
+
fontSize: el.style.fontSize,
|
|
196
|
+
fontFace: el.style.fontFace,
|
|
197
|
+
color: el.style.color,
|
|
198
|
+
align: el.style.align,
|
|
199
|
+
valign: 'top',
|
|
200
|
+
lineSpacing: el.style.lineSpacing,
|
|
201
|
+
paraSpaceBefore: el.style.paraSpaceBefore,
|
|
202
|
+
paraSpaceAfter: el.style.paraSpaceAfter,
|
|
203
|
+
margin: el.style.margin,
|
|
204
|
+
inset: 0
|
|
205
|
+
};
|
|
206
|
+
if (el.style.transparency != null) mergedOptions.transparency = el.style.transparency;
|
|
207
|
+
targetSlide.addText(el.items, mergedOptions);
|
|
208
|
+
} else {
|
|
209
|
+
// Check if text is single-line (height suggests one line)
|
|
210
|
+
const lineHeight = el.style.lineSpacing || el.style.fontSize * 1.2;
|
|
211
|
+
const isSingleLine = el.position.h <= lineHeight * 1.5;
|
|
212
|
+
|
|
213
|
+
let adjustedX = el.position.x;
|
|
214
|
+
let adjustedW = el.position.w;
|
|
215
|
+
|
|
216
|
+
// Make single-line text 2% wider to account for underestimate
|
|
217
|
+
if (isSingleLine) {
|
|
218
|
+
const widthIncrease = el.position.w * 0.02;
|
|
219
|
+
const align = el.style.align;
|
|
220
|
+
|
|
221
|
+
if (align === 'center') {
|
|
222
|
+
// Center: expand both sides
|
|
223
|
+
adjustedX = el.position.x - (widthIncrease / 2);
|
|
224
|
+
adjustedW = el.position.w + widthIncrease;
|
|
225
|
+
} else if (align === 'right') {
|
|
226
|
+
// Right: expand to the left
|
|
227
|
+
adjustedX = el.position.x - widthIncrease;
|
|
228
|
+
adjustedW = el.position.w + widthIncrease;
|
|
229
|
+
} else {
|
|
230
|
+
// Left (default): expand to the right
|
|
231
|
+
adjustedW = el.position.w + widthIncrease;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const textOptions = {
|
|
236
|
+
x: adjustedX,
|
|
237
|
+
y: el.position.y,
|
|
238
|
+
w: adjustedW,
|
|
239
|
+
h: el.position.h,
|
|
240
|
+
fontSize: el.style.fontSize,
|
|
241
|
+
fontFace: el.style.fontFace,
|
|
242
|
+
color: el.style.color,
|
|
243
|
+
bold: el.style.bold,
|
|
244
|
+
italic: el.style.italic,
|
|
245
|
+
underline: el.style.underline,
|
|
246
|
+
valign: 'top',
|
|
247
|
+
lineSpacing: el.style.lineSpacing,
|
|
248
|
+
paraSpaceBefore: el.style.paraSpaceBefore,
|
|
249
|
+
paraSpaceAfter: el.style.paraSpaceAfter,
|
|
250
|
+
inset: 0 // Remove default PowerPoint internal padding
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
if (el.style.align) textOptions.align = el.style.align;
|
|
254
|
+
if (el.style.margin) textOptions.margin = el.style.margin;
|
|
255
|
+
if (el.style.rotate !== undefined) textOptions.rotate = el.style.rotate;
|
|
256
|
+
if (el.style.transparency !== null && el.style.transparency !== undefined) textOptions.transparency = el.style.transparency;
|
|
257
|
+
|
|
258
|
+
targetSlide.addText(el.text, textOptions);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Helper: Extract slide data from HTML page
|
|
264
|
+
async function extractSlideData(page) {
|
|
265
|
+
return await page.evaluate(() => {
|
|
266
|
+
const PT_PER_PX = 0.75;
|
|
267
|
+
const PX_PER_IN = 96;
|
|
268
|
+
|
|
269
|
+
// Fonts that are single-weight and should not have bold applied
|
|
270
|
+
// (applying bold causes PowerPoint to use faux bold which makes text wider)
|
|
271
|
+
const SINGLE_WEIGHT_FONTS = ['impact'];
|
|
272
|
+
|
|
273
|
+
// Helper: Check if a font should skip bold formatting
|
|
274
|
+
const shouldSkipBold = (fontFamily) => {
|
|
275
|
+
if (!fontFamily) return false;
|
|
276
|
+
const normalizedFont = fontFamily.toLowerCase().replace(/['"]/g, '').split(',')[0].trim();
|
|
277
|
+
return SINGLE_WEIGHT_FONTS.includes(normalizedFont);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// Unit conversion helpers
|
|
281
|
+
const pxToInch = (px) => px / PX_PER_IN;
|
|
282
|
+
const pxToPoints = (pxStr) => parseFloat(pxStr) * PT_PER_PX;
|
|
283
|
+
const rgbToHex = (rgbStr) => {
|
|
284
|
+
// Handle transparent backgrounds by defaulting to white
|
|
285
|
+
if (rgbStr === 'rgba(0, 0, 0, 0)' || rgbStr === 'transparent') return 'FFFFFF';
|
|
286
|
+
|
|
287
|
+
const match = rgbStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
288
|
+
if (!match) return 'FFFFFF';
|
|
289
|
+
return match.slice(1).map(n => parseInt(n).toString(16).padStart(2, '0')).join('');
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
const extractAlpha = (rgbStr) => {
|
|
293
|
+
const match = rgbStr.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
294
|
+
if (!match || !match[4]) return null;
|
|
295
|
+
const alpha = parseFloat(match[4]);
|
|
296
|
+
return Math.round((1 - alpha) * 100);
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
const applyTextTransform = (text, textTransform) => {
|
|
300
|
+
if (textTransform === 'uppercase') return text.toUpperCase();
|
|
301
|
+
if (textTransform === 'lowercase') return text.toLowerCase();
|
|
302
|
+
if (textTransform === 'capitalize') {
|
|
303
|
+
return text.replace(/\b\w/g, c => c.toUpperCase());
|
|
304
|
+
}
|
|
305
|
+
return text;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
// Extract rotation angle from CSS transform and writing-mode
|
|
309
|
+
const getRotation = (transform, writingMode) => {
|
|
310
|
+
let angle = 0;
|
|
311
|
+
|
|
312
|
+
// Handle writing-mode first
|
|
313
|
+
// PowerPoint: 90° = text rotated 90° clockwise (reads top to bottom, letters upright)
|
|
314
|
+
// PowerPoint: 270° = text rotated 270° clockwise (reads bottom to top, letters upright)
|
|
315
|
+
if (writingMode === 'vertical-rl') {
|
|
316
|
+
// vertical-rl alone = text reads top to bottom = 90° in PowerPoint
|
|
317
|
+
angle = 90;
|
|
318
|
+
} else if (writingMode === 'vertical-lr') {
|
|
319
|
+
// vertical-lr alone = text reads bottom to top = 270° in PowerPoint
|
|
320
|
+
angle = 270;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Then add any transform rotation
|
|
324
|
+
if (transform && transform !== 'none') {
|
|
325
|
+
// Try to match rotate() function
|
|
326
|
+
const rotateMatch = transform.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
|
|
327
|
+
if (rotateMatch) {
|
|
328
|
+
angle += parseFloat(rotateMatch[1]);
|
|
329
|
+
} else {
|
|
330
|
+
// Browser may compute as matrix - extract rotation from matrix
|
|
331
|
+
const matrixMatch = transform.match(/matrix\(([^)]+)\)/);
|
|
332
|
+
if (matrixMatch) {
|
|
333
|
+
const values = matrixMatch[1].split(',').map(parseFloat);
|
|
334
|
+
// matrix(a, b, c, d, e, f) where rotation = atan2(b, a)
|
|
335
|
+
const matrixAngle = Math.atan2(values[1], values[0]) * (180 / Math.PI);
|
|
336
|
+
angle += Math.round(matrixAngle);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Normalize to 0-359 range
|
|
342
|
+
angle = angle % 360;
|
|
343
|
+
if (angle < 0) angle += 360;
|
|
344
|
+
|
|
345
|
+
return angle === 0 ? null : angle;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// Get position/dimensions accounting for rotation
|
|
349
|
+
const getPositionAndSize = (el, rect, rotation) => {
|
|
350
|
+
if (rotation === null) {
|
|
351
|
+
return { x: rect.left, y: rect.top, w: rect.width, h: rect.height };
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// For 90° or 270° rotations, swap width and height
|
|
355
|
+
// because PowerPoint applies rotation to the original (unrotated) box
|
|
356
|
+
const isVertical = rotation === 90 || rotation === 270;
|
|
357
|
+
|
|
358
|
+
if (isVertical) {
|
|
359
|
+
// The browser shows us the rotated dimensions (tall box for vertical text)
|
|
360
|
+
// But PowerPoint needs the pre-rotation dimensions (wide box that will be rotated)
|
|
361
|
+
// So we swap: browser's height becomes PPT's width, browser's width becomes PPT's height
|
|
362
|
+
const centerX = rect.left + rect.width / 2;
|
|
363
|
+
const centerY = rect.top + rect.height / 2;
|
|
364
|
+
|
|
365
|
+
return {
|
|
366
|
+
x: centerX - rect.height / 2,
|
|
367
|
+
y: centerY - rect.width / 2,
|
|
368
|
+
w: rect.height,
|
|
369
|
+
h: rect.width
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// For other rotations, use element's offset dimensions
|
|
374
|
+
const centerX = rect.left + rect.width / 2;
|
|
375
|
+
const centerY = rect.top + rect.height / 2;
|
|
376
|
+
return {
|
|
377
|
+
x: centerX - el.offsetWidth / 2,
|
|
378
|
+
y: centerY - el.offsetHeight / 2,
|
|
379
|
+
w: el.offsetWidth,
|
|
380
|
+
h: el.offsetHeight
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// Parse CSS box-shadow into PptxGenJS shadow properties
|
|
385
|
+
const parseBoxShadow = (boxShadow) => {
|
|
386
|
+
if (!boxShadow || boxShadow === 'none') return null;
|
|
387
|
+
|
|
388
|
+
// Browser computed style format: "rgba(0, 0, 0, 0.3) 2px 2px 8px 0px [inset]"
|
|
389
|
+
// CSS format: "[inset] 2px 2px 8px 0px rgba(0, 0, 0, 0.3)"
|
|
390
|
+
|
|
391
|
+
const insetMatch = boxShadow.match(/inset/);
|
|
392
|
+
|
|
393
|
+
// IMPORTANT: PptxGenJS/PowerPoint doesn't properly support inset shadows
|
|
394
|
+
// Only process outer shadows to avoid file corruption
|
|
395
|
+
if (insetMatch) return null;
|
|
396
|
+
|
|
397
|
+
// Extract color first (rgba or rgb at start)
|
|
398
|
+
const colorMatch = boxShadow.match(/rgba?\([^)]+\)/);
|
|
399
|
+
|
|
400
|
+
// Extract numeric values (handles both px and pt units)
|
|
401
|
+
const parts = boxShadow.match(/([-\d.]+)(px|pt)/g);
|
|
402
|
+
|
|
403
|
+
if (!parts || parts.length < 2) return null;
|
|
404
|
+
|
|
405
|
+
const offsetX = parseFloat(parts[0]);
|
|
406
|
+
const offsetY = parseFloat(parts[1]);
|
|
407
|
+
const blur = parts.length > 2 ? parseFloat(parts[2]) : 0;
|
|
408
|
+
|
|
409
|
+
// Calculate angle from offsets (in degrees, 0 = right, 90 = down)
|
|
410
|
+
let angle = 0;
|
|
411
|
+
if (offsetX !== 0 || offsetY !== 0) {
|
|
412
|
+
angle = Math.atan2(offsetY, offsetX) * (180 / Math.PI);
|
|
413
|
+
if (angle < 0) angle += 360;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// Calculate offset distance (hypotenuse)
|
|
417
|
+
const offset = Math.sqrt(offsetX * offsetX + offsetY * offsetY) * PT_PER_PX;
|
|
418
|
+
|
|
419
|
+
// Extract opacity from rgba
|
|
420
|
+
let opacity = 0.5;
|
|
421
|
+
if (colorMatch) {
|
|
422
|
+
const opacityMatch = colorMatch[0].match(/[\d.]+\)$/);
|
|
423
|
+
if (opacityMatch) {
|
|
424
|
+
opacity = parseFloat(opacityMatch[0].replace(')', ''));
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return {
|
|
429
|
+
type: 'outer',
|
|
430
|
+
angle: Math.round(angle),
|
|
431
|
+
blur: blur * 0.75, // Convert to points
|
|
432
|
+
color: colorMatch ? rgbToHex(colorMatch[0]) : '000000',
|
|
433
|
+
offset: offset,
|
|
434
|
+
opacity
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
// Parse inline formatting tags (<b>, <i>, <u>, <strong>, <em>, <span>) into text runs
|
|
439
|
+
const parseInlineFormatting = (element, baseOptions = {}, runs = [], baseTextTransform = (x) => x) => {
|
|
440
|
+
let prevNodeIsText = false;
|
|
441
|
+
|
|
442
|
+
element.childNodes.forEach((node) => {
|
|
443
|
+
let textTransform = baseTextTransform;
|
|
444
|
+
|
|
445
|
+
const isText = node.nodeType === Node.TEXT_NODE || node.tagName === 'BR';
|
|
446
|
+
if (isText) {
|
|
447
|
+
const text = node.tagName === 'BR' ? '\n' : textTransform(node.textContent.replace(/\s+/g, ' '));
|
|
448
|
+
const prevRun = runs[runs.length - 1];
|
|
449
|
+
if (prevNodeIsText && prevRun) {
|
|
450
|
+
prevRun.text += text;
|
|
451
|
+
} else {
|
|
452
|
+
runs.push({ text, options: { ...baseOptions } });
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
} else if (node.nodeType === Node.ELEMENT_NODE && node.textContent.trim()) {
|
|
456
|
+
const options = { ...baseOptions };
|
|
457
|
+
const computed = window.getComputedStyle(node);
|
|
458
|
+
|
|
459
|
+
// Handle inline elements with computed styles
|
|
460
|
+
if (node.tagName === 'SPAN' || node.tagName === 'B' || node.tagName === 'STRONG' || node.tagName === 'I' || node.tagName === 'EM' || node.tagName === 'U') {
|
|
461
|
+
const isBold = computed.fontWeight === 'bold' || parseInt(computed.fontWeight) >= 600;
|
|
462
|
+
if (isBold && !shouldSkipBold(computed.fontFamily)) options.bold = true;
|
|
463
|
+
if (computed.fontStyle === 'italic') options.italic = true;
|
|
464
|
+
if (computed.textDecoration && computed.textDecoration.includes('underline')) options.underline = true;
|
|
465
|
+
if (computed.color && computed.color !== 'rgb(0, 0, 0)') {
|
|
466
|
+
options.color = rgbToHex(computed.color);
|
|
467
|
+
const transparency = extractAlpha(computed.color);
|
|
468
|
+
if (transparency !== null) options.transparency = transparency;
|
|
469
|
+
}
|
|
470
|
+
if (computed.fontSize) options.fontSize = pxToPoints(computed.fontSize);
|
|
471
|
+
|
|
472
|
+
// Apply text-transform on the span element itself
|
|
473
|
+
if (computed.textTransform && computed.textTransform !== 'none') {
|
|
474
|
+
const transformStr = computed.textTransform;
|
|
475
|
+
textTransform = (text) => applyTextTransform(text, transformStr);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Validate: Check for margins on inline elements
|
|
479
|
+
if (computed.marginLeft && parseFloat(computed.marginLeft) > 0) {
|
|
480
|
+
errors.push(`Inline element <${node.tagName.toLowerCase()}> has margin-left which is not supported in PowerPoint. Remove margin from inline elements.`);
|
|
481
|
+
}
|
|
482
|
+
if (computed.marginRight && parseFloat(computed.marginRight) > 0) {
|
|
483
|
+
errors.push(`Inline element <${node.tagName.toLowerCase()}> has margin-right which is not supported in PowerPoint. Remove margin from inline elements.`);
|
|
484
|
+
}
|
|
485
|
+
if (computed.marginTop && parseFloat(computed.marginTop) > 0) {
|
|
486
|
+
errors.push(`Inline element <${node.tagName.toLowerCase()}> has margin-top which is not supported in PowerPoint. Remove margin from inline elements.`);
|
|
487
|
+
}
|
|
488
|
+
if (computed.marginBottom && parseFloat(computed.marginBottom) > 0) {
|
|
489
|
+
errors.push(`Inline element <${node.tagName.toLowerCase()}> has margin-bottom which is not supported in PowerPoint. Remove margin from inline elements.`);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Recursively process the child node. This will flatten nested spans into multiple runs.
|
|
493
|
+
parseInlineFormatting(node, options, runs, textTransform);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
prevNodeIsText = isText;
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
// Trim leading space from first run and trailing space from last run
|
|
501
|
+
if (runs.length > 0) {
|
|
502
|
+
runs[0].text = runs[0].text.replace(/^\s+/, '');
|
|
503
|
+
runs[runs.length - 1].text = runs[runs.length - 1].text.replace(/\s+$/, '');
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return runs.filter(r => r.text.length > 0);
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
// Extract background from body (image or color)
|
|
510
|
+
const body = document.body;
|
|
511
|
+
const bodyStyle = window.getComputedStyle(body);
|
|
512
|
+
const bgImage = bodyStyle.backgroundImage;
|
|
513
|
+
const bgColor = bodyStyle.backgroundColor;
|
|
514
|
+
|
|
515
|
+
// Collect validation errors
|
|
516
|
+
const errors = [];
|
|
517
|
+
|
|
518
|
+
// Validate: Check for CSS gradients
|
|
519
|
+
if (bgImage && (bgImage.includes('linear-gradient') || bgImage.includes('radial-gradient'))) {
|
|
520
|
+
errors.push(
|
|
521
|
+
'CSS gradients are not supported. Use Sharp to rasterize gradients as PNG images first, ' +
|
|
522
|
+
'then reference with background-image: url(\'gradient.png\')'
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
let background;
|
|
527
|
+
if (bgImage && bgImage !== 'none') {
|
|
528
|
+
// Extract URL from url("...") or url(...)
|
|
529
|
+
const urlMatch = bgImage.match(/url\(["']?([^"')]+)["']?\)/);
|
|
530
|
+
if (urlMatch) {
|
|
531
|
+
background = {
|
|
532
|
+
type: 'image',
|
|
533
|
+
path: urlMatch[1]
|
|
534
|
+
};
|
|
535
|
+
} else {
|
|
536
|
+
background = {
|
|
537
|
+
type: 'color',
|
|
538
|
+
value: rgbToHex(bgColor)
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
} else {
|
|
542
|
+
background = {
|
|
543
|
+
type: 'color',
|
|
544
|
+
value: rgbToHex(bgColor)
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// Process all elements
|
|
549
|
+
const elements = [];
|
|
550
|
+
const placeholders = [];
|
|
551
|
+
const textTags = ['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'UL', 'OL', 'LI'];
|
|
552
|
+
const processed = new Set();
|
|
553
|
+
|
|
554
|
+
document.querySelectorAll('*').forEach((el) => {
|
|
555
|
+
if (processed.has(el)) return;
|
|
556
|
+
|
|
557
|
+
// [data-pptx-merge="true"] — opt-in: merge all <p>/<h1>-<h6> descendants
|
|
558
|
+
// into ONE PowerPoint text frame (single editable text box).
|
|
559
|
+
// Each child paragraph becomes a run with breakLine:true at the end;
|
|
560
|
+
// per-paragraph fontSize/color/bold/italic/underline are preserved as run options.
|
|
561
|
+
// The container's bg/border (if any) still becomes its own shape, same as a normal div.
|
|
562
|
+
if (el.tagName === 'DIV' && el.dataset && el.dataset.pptxMerge === 'true') {
|
|
563
|
+
const containerRect = el.getBoundingClientRect();
|
|
564
|
+
if (containerRect.width === 0 || containerRect.height === 0) {
|
|
565
|
+
processed.add(el);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
// Reject nested merge containers — undefined behavior.
|
|
570
|
+
if (el.querySelector('[data-pptx-merge="true"]')) {
|
|
571
|
+
errors.push(
|
|
572
|
+
`data-pptx-merge container cannot contain another data-pptx-merge container. ` +
|
|
573
|
+
'Nested merge is not supported.'
|
|
574
|
+
);
|
|
575
|
+
processed.add(el);
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
const mergeComputed = window.getComputedStyle(el);
|
|
580
|
+
|
|
581
|
+
// Container background image — same restriction as regular divs.
|
|
582
|
+
if (mergeComputed.backgroundImage && mergeComputed.backgroundImage !== 'none') {
|
|
583
|
+
errors.push(
|
|
584
|
+
'Background images on data-pptx-merge container are not supported. ' +
|
|
585
|
+
'Use solid colors or borders, or layer images via slide.addImage().'
|
|
586
|
+
);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// Emit a shape for the container's bg/uniform-border (mirrors the regular div branch).
|
|
591
|
+
const mHasBg = mergeComputed.backgroundColor && mergeComputed.backgroundColor !== 'rgba(0, 0, 0, 0)';
|
|
592
|
+
const mBorders = [
|
|
593
|
+
mergeComputed.borderTopWidth,
|
|
594
|
+
mergeComputed.borderRightWidth,
|
|
595
|
+
mergeComputed.borderBottomWidth,
|
|
596
|
+
mergeComputed.borderLeftWidth
|
|
597
|
+
].map(b => parseFloat(b) || 0);
|
|
598
|
+
const mHasBorder = mBorders.some(b => b > 0);
|
|
599
|
+
const mHasUniformBorder = mHasBorder && mBorders.every(b => b === mBorders[0]);
|
|
600
|
+
|
|
601
|
+
if (mHasBg || mHasUniformBorder) {
|
|
602
|
+
elements.push({
|
|
603
|
+
type: 'shape',
|
|
604
|
+
text: '',
|
|
605
|
+
position: {
|
|
606
|
+
x: pxToInch(containerRect.left),
|
|
607
|
+
y: pxToInch(containerRect.top),
|
|
608
|
+
w: pxToInch(containerRect.width),
|
|
609
|
+
h: pxToInch(containerRect.height)
|
|
610
|
+
},
|
|
611
|
+
shape: {
|
|
612
|
+
fill: mHasBg ? rgbToHex(mergeComputed.backgroundColor) : null,
|
|
613
|
+
transparency: mHasBg ? extractAlpha(mergeComputed.backgroundColor) : null,
|
|
614
|
+
line: mHasUniformBorder ? {
|
|
615
|
+
color: rgbToHex(mergeComputed.borderColor),
|
|
616
|
+
width: pxToPoints(mergeComputed.borderWidth)
|
|
617
|
+
} : null,
|
|
618
|
+
rectRadius: (() => {
|
|
619
|
+
const radius = mergeComputed.borderRadius;
|
|
620
|
+
const radiusValue = parseFloat(radius);
|
|
621
|
+
if (radiusValue === 0) return 0;
|
|
622
|
+
if (radius.includes('%')) {
|
|
623
|
+
if (radiusValue >= 50) return 1;
|
|
624
|
+
const minDim = Math.min(containerRect.width, containerRect.height);
|
|
625
|
+
return (radiusValue / 100) * pxToInch(minDim);
|
|
626
|
+
}
|
|
627
|
+
if (radius.includes('pt')) return radiusValue / 72;
|
|
628
|
+
return radiusValue / PX_PER_IN;
|
|
629
|
+
})(),
|
|
630
|
+
shadow: parseBoxShadow(mergeComputed.boxShadow)
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
// Collect <p>/<h*> descendants in document order.
|
|
636
|
+
const textDescendants = Array.from(el.querySelectorAll('p, h1, h2, h3, h4, h5, h6'));
|
|
637
|
+
if (textDescendants.length === 0) {
|
|
638
|
+
errors.push(
|
|
639
|
+
`data-pptx-merge container has no <p>/<h*> children to merge. ` +
|
|
640
|
+
'Remove the data-pptx-merge attribute or add text elements.'
|
|
641
|
+
);
|
|
642
|
+
processed.add(el);
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// Use the first text element's computed style as the textbox-level base
|
|
647
|
+
// (align / lineSpacing / paraSpace are paragraph/textbox-level in pptxgenjs, not per-run).
|
|
648
|
+
const firstComputed = window.getComputedStyle(textDescendants[0]);
|
|
649
|
+
const baseStyle = {
|
|
650
|
+
fontSize: pxToPoints(firstComputed.fontSize),
|
|
651
|
+
fontFace: firstComputed.fontFamily.split(',')[0].replace(/['"]/g, '').trim(),
|
|
652
|
+
color: rgbToHex(firstComputed.color),
|
|
653
|
+
align: firstComputed.textAlign === 'start' ? 'left' : firstComputed.textAlign,
|
|
654
|
+
lineSpacing: firstComputed.lineHeight && firstComputed.lineHeight !== 'normal'
|
|
655
|
+
? pxToPoints(firstComputed.lineHeight)
|
|
656
|
+
: null,
|
|
657
|
+
paraSpaceBefore: 0,
|
|
658
|
+
paraSpaceAfter: 0,
|
|
659
|
+
// Container padding becomes the textbox internal margin (PptxGenJS: [left, right, bottom, top]).
|
|
660
|
+
margin: [
|
|
661
|
+
pxToPoints(mergeComputed.paddingLeft),
|
|
662
|
+
pxToPoints(mergeComputed.paddingRight),
|
|
663
|
+
pxToPoints(mergeComputed.paddingBottom),
|
|
664
|
+
pxToPoints(mergeComputed.paddingTop)
|
|
665
|
+
]
|
|
666
|
+
};
|
|
667
|
+
const baseTransparency = extractAlpha(firstComputed.color);
|
|
668
|
+
if (baseTransparency !== null) baseStyle.transparency = baseTransparency;
|
|
669
|
+
|
|
670
|
+
// Build the merged runs.
|
|
671
|
+
const mergedRuns = [];
|
|
672
|
+
textDescendants.forEach((textEl, idx) => {
|
|
673
|
+
const isLast = idx === textDescendants.length - 1;
|
|
674
|
+
const tComputed = window.getComputedStyle(textEl);
|
|
675
|
+
const transformStr = tComputed.textTransform;
|
|
676
|
+
|
|
677
|
+
// Per-paragraph style overrides — only include if they differ from base.
|
|
678
|
+
const elemFontSize = pxToPoints(tComputed.fontSize);
|
|
679
|
+
const elemFontFace = tComputed.fontFamily.split(',')[0].replace(/['"]/g, '').trim();
|
|
680
|
+
const elemColor = rgbToHex(tComputed.color);
|
|
681
|
+
const elemBold = tComputed.fontWeight === 'bold' || parseInt(tComputed.fontWeight) >= 600;
|
|
682
|
+
const elemItalic = tComputed.fontStyle === 'italic';
|
|
683
|
+
const elemUnderline = tComputed.textDecoration.includes('underline');
|
|
684
|
+
|
|
685
|
+
const runBaseOptions = {};
|
|
686
|
+
if (elemFontSize !== baseStyle.fontSize) runBaseOptions.fontSize = elemFontSize;
|
|
687
|
+
if (elemFontFace !== baseStyle.fontFace) runBaseOptions.fontFace = elemFontFace;
|
|
688
|
+
if (elemColor !== baseStyle.color) runBaseOptions.color = elemColor;
|
|
689
|
+
if (elemBold && !shouldSkipBold(tComputed.fontFamily)) runBaseOptions.bold = true;
|
|
690
|
+
if (elemItalic) runBaseOptions.italic = true;
|
|
691
|
+
if (elemUnderline) runBaseOptions.underline = true;
|
|
692
|
+
|
|
693
|
+
const hasInline = textEl.querySelector('b, i, u, strong, em, span, br');
|
|
694
|
+
let runs;
|
|
695
|
+
if (hasInline) {
|
|
696
|
+
runs = parseInlineFormatting(
|
|
697
|
+
textEl,
|
|
698
|
+
runBaseOptions,
|
|
699
|
+
[],
|
|
700
|
+
(str) => applyTextTransform(str, transformStr)
|
|
701
|
+
);
|
|
702
|
+
} else {
|
|
703
|
+
const txt = applyTextTransform(textEl.textContent.trim(), transformStr);
|
|
704
|
+
if (!txt) return;
|
|
705
|
+
runs = [{ text: txt, options: { ...runBaseOptions } }];
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if (runs.length > 0 && !isLast) {
|
|
709
|
+
runs[runs.length - 1].options.breakLine = true;
|
|
710
|
+
}
|
|
711
|
+
mergedRuns.push(...runs);
|
|
712
|
+
processed.add(textEl);
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
if (mergedRuns.length === 0) {
|
|
716
|
+
processed.add(el);
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
elements.push({
|
|
721
|
+
type: 'merged-text',
|
|
722
|
+
items: mergedRuns,
|
|
723
|
+
position: {
|
|
724
|
+
x: pxToInch(containerRect.left),
|
|
725
|
+
y: pxToInch(containerRect.top),
|
|
726
|
+
w: pxToInch(containerRect.width),
|
|
727
|
+
h: pxToInch(containerRect.height)
|
|
728
|
+
},
|
|
729
|
+
style: baseStyle
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
processed.add(el);
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// Validate text elements don't have backgrounds, borders, or shadows
|
|
737
|
+
if (textTags.includes(el.tagName)) {
|
|
738
|
+
const computed = window.getComputedStyle(el);
|
|
739
|
+
const hasBg = computed.backgroundColor && computed.backgroundColor !== 'rgba(0, 0, 0, 0)';
|
|
740
|
+
const hasBorder = (computed.borderWidth && parseFloat(computed.borderWidth) > 0) ||
|
|
741
|
+
(computed.borderTopWidth && parseFloat(computed.borderTopWidth) > 0) ||
|
|
742
|
+
(computed.borderRightWidth && parseFloat(computed.borderRightWidth) > 0) ||
|
|
743
|
+
(computed.borderBottomWidth && parseFloat(computed.borderBottomWidth) > 0) ||
|
|
744
|
+
(computed.borderLeftWidth && parseFloat(computed.borderLeftWidth) > 0);
|
|
745
|
+
const hasShadow = computed.boxShadow && computed.boxShadow !== 'none';
|
|
746
|
+
|
|
747
|
+
if (hasBg || hasBorder || hasShadow) {
|
|
748
|
+
errors.push(
|
|
749
|
+
`Text element <${el.tagName.toLowerCase()}> has ${hasBg ? 'background' : hasBorder ? 'border' : 'shadow'}. ` +
|
|
750
|
+
'Backgrounds, borders, and shadows are only supported on <div> elements, not text elements.'
|
|
751
|
+
);
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// Extract placeholder elements (for charts, etc.)
|
|
757
|
+
if (el.className && el.className.includes('placeholder')) {
|
|
758
|
+
const rect = el.getBoundingClientRect();
|
|
759
|
+
if (rect.width === 0 || rect.height === 0) {
|
|
760
|
+
errors.push(
|
|
761
|
+
`Placeholder "${el.id || 'unnamed'}" has ${rect.width === 0 ? 'width: 0' : 'height: 0'}. Check the layout CSS.`
|
|
762
|
+
);
|
|
763
|
+
} else {
|
|
764
|
+
placeholders.push({
|
|
765
|
+
id: el.id || `placeholder-${placeholders.length}`,
|
|
766
|
+
x: pxToInch(rect.left),
|
|
767
|
+
y: pxToInch(rect.top),
|
|
768
|
+
w: pxToInch(rect.width),
|
|
769
|
+
h: pxToInch(rect.height)
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
processed.add(el);
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// Extract images
|
|
777
|
+
if (el.tagName === 'IMG') {
|
|
778
|
+
const rect = el.getBoundingClientRect();
|
|
779
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
780
|
+
elements.push({
|
|
781
|
+
type: 'image',
|
|
782
|
+
src: el.src,
|
|
783
|
+
position: {
|
|
784
|
+
x: pxToInch(rect.left),
|
|
785
|
+
y: pxToInch(rect.top),
|
|
786
|
+
w: pxToInch(rect.width),
|
|
787
|
+
h: pxToInch(rect.height)
|
|
788
|
+
}
|
|
789
|
+
});
|
|
790
|
+
processed.add(el);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// Extract DIVs with backgrounds/borders as shapes
|
|
796
|
+
const isContainer = el.tagName === 'DIV' && !textTags.includes(el.tagName);
|
|
797
|
+
if (isContainer) {
|
|
798
|
+
const computed = window.getComputedStyle(el);
|
|
799
|
+
const hasBg = computed.backgroundColor && computed.backgroundColor !== 'rgba(0, 0, 0, 0)';
|
|
800
|
+
|
|
801
|
+
// Validate: Check for unwrapped text content in DIV
|
|
802
|
+
for (const node of el.childNodes) {
|
|
803
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
804
|
+
const text = node.textContent.trim();
|
|
805
|
+
if (text) {
|
|
806
|
+
errors.push(
|
|
807
|
+
`DIV element contains unwrapped text "${text.substring(0, 50)}${text.length > 50 ? '...' : ''}". ` +
|
|
808
|
+
'All text must be wrapped in <p>, <h1>-<h6>, <ul>, or <ol> tags to appear in PowerPoint.'
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// Check for background images on shapes
|
|
815
|
+
const bgImage = computed.backgroundImage;
|
|
816
|
+
if (bgImage && bgImage !== 'none') {
|
|
817
|
+
errors.push(
|
|
818
|
+
'Background images on DIV elements are not supported. ' +
|
|
819
|
+
'Use solid colors or borders for shapes, or use slide.addImage() in PptxGenJS to layer images.'
|
|
820
|
+
);
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// Check for borders - both uniform and partial
|
|
825
|
+
const borderTop = computed.borderTopWidth;
|
|
826
|
+
const borderRight = computed.borderRightWidth;
|
|
827
|
+
const borderBottom = computed.borderBottomWidth;
|
|
828
|
+
const borderLeft = computed.borderLeftWidth;
|
|
829
|
+
const borders = [borderTop, borderRight, borderBottom, borderLeft].map(b => parseFloat(b) || 0);
|
|
830
|
+
const hasBorder = borders.some(b => b > 0);
|
|
831
|
+
const hasUniformBorder = hasBorder && borders.every(b => b === borders[0]);
|
|
832
|
+
const borderLines = [];
|
|
833
|
+
|
|
834
|
+
if (hasBorder && !hasUniformBorder) {
|
|
835
|
+
const rect = el.getBoundingClientRect();
|
|
836
|
+
const x = pxToInch(rect.left);
|
|
837
|
+
const y = pxToInch(rect.top);
|
|
838
|
+
const w = pxToInch(rect.width);
|
|
839
|
+
const h = pxToInch(rect.height);
|
|
840
|
+
|
|
841
|
+
// Collect lines to add after shape (inset by half the line width to center on edge)
|
|
842
|
+
if (parseFloat(borderTop) > 0) {
|
|
843
|
+
const widthPt = pxToPoints(borderTop);
|
|
844
|
+
const inset = (widthPt / 72) / 2; // Convert points to inches, then half
|
|
845
|
+
borderLines.push({
|
|
846
|
+
type: 'line',
|
|
847
|
+
x1: x, y1: y + inset, x2: x + w, y2: y + inset,
|
|
848
|
+
width: widthPt,
|
|
849
|
+
color: rgbToHex(computed.borderTopColor)
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
if (parseFloat(borderRight) > 0) {
|
|
853
|
+
const widthPt = pxToPoints(borderRight);
|
|
854
|
+
const inset = (widthPt / 72) / 2;
|
|
855
|
+
borderLines.push({
|
|
856
|
+
type: 'line',
|
|
857
|
+
x1: x + w - inset, y1: y, x2: x + w - inset, y2: y + h,
|
|
858
|
+
width: widthPt,
|
|
859
|
+
color: rgbToHex(computed.borderRightColor)
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
if (parseFloat(borderBottom) > 0) {
|
|
863
|
+
const widthPt = pxToPoints(borderBottom);
|
|
864
|
+
const inset = (widthPt / 72) / 2;
|
|
865
|
+
borderLines.push({
|
|
866
|
+
type: 'line',
|
|
867
|
+
x1: x, y1: y + h - inset, x2: x + w, y2: y + h - inset,
|
|
868
|
+
width: widthPt,
|
|
869
|
+
color: rgbToHex(computed.borderBottomColor)
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
if (parseFloat(borderLeft) > 0) {
|
|
873
|
+
const widthPt = pxToPoints(borderLeft);
|
|
874
|
+
const inset = (widthPt / 72) / 2;
|
|
875
|
+
borderLines.push({
|
|
876
|
+
type: 'line',
|
|
877
|
+
x1: x + inset, y1: y, x2: x + inset, y2: y + h,
|
|
878
|
+
width: widthPt,
|
|
879
|
+
color: rgbToHex(computed.borderLeftColor)
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
if (hasBg || hasBorder) {
|
|
885
|
+
const rect = el.getBoundingClientRect();
|
|
886
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
887
|
+
const shadow = parseBoxShadow(computed.boxShadow);
|
|
888
|
+
|
|
889
|
+
// Only add shape if there's background or uniform border
|
|
890
|
+
if (hasBg || hasUniformBorder) {
|
|
891
|
+
elements.push({
|
|
892
|
+
type: 'shape',
|
|
893
|
+
text: '', // Shape only - child text elements render on top
|
|
894
|
+
position: {
|
|
895
|
+
x: pxToInch(rect.left),
|
|
896
|
+
y: pxToInch(rect.top),
|
|
897
|
+
w: pxToInch(rect.width),
|
|
898
|
+
h: pxToInch(rect.height)
|
|
899
|
+
},
|
|
900
|
+
shape: {
|
|
901
|
+
fill: hasBg ? rgbToHex(computed.backgroundColor) : null,
|
|
902
|
+
transparency: hasBg ? extractAlpha(computed.backgroundColor) : null,
|
|
903
|
+
line: hasUniformBorder ? {
|
|
904
|
+
color: rgbToHex(computed.borderColor),
|
|
905
|
+
width: pxToPoints(computed.borderWidth)
|
|
906
|
+
} : null,
|
|
907
|
+
// Convert border-radius to rectRadius (in inches)
|
|
908
|
+
// % values: 50%+ = circle (1), <50% = percentage of min dimension
|
|
909
|
+
// pt values: divide by 72 (72pt = 1 inch)
|
|
910
|
+
// px values: divide by 96 (96px = 1 inch)
|
|
911
|
+
rectRadius: (() => {
|
|
912
|
+
const radius = computed.borderRadius;
|
|
913
|
+
const radiusValue = parseFloat(radius);
|
|
914
|
+
if (radiusValue === 0) return 0;
|
|
915
|
+
|
|
916
|
+
if (radius.includes('%')) {
|
|
917
|
+
if (radiusValue >= 50) return 1;
|
|
918
|
+
// Calculate percentage of smaller dimension
|
|
919
|
+
const minDim = Math.min(rect.width, rect.height);
|
|
920
|
+
return (radiusValue / 100) * pxToInch(minDim);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
if (radius.includes('pt')) return radiusValue / 72;
|
|
924
|
+
return radiusValue / PX_PER_IN;
|
|
925
|
+
})(),
|
|
926
|
+
shadow: shadow
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// Add partial border lines
|
|
932
|
+
elements.push(...borderLines);
|
|
933
|
+
|
|
934
|
+
processed.add(el);
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
// Extract bullet lists as single text block
|
|
941
|
+
if (el.tagName === 'UL' || el.tagName === 'OL') {
|
|
942
|
+
const rect = el.getBoundingClientRect();
|
|
943
|
+
if (rect.width === 0 || rect.height === 0) return;
|
|
944
|
+
|
|
945
|
+
const liElements = Array.from(el.querySelectorAll('li'));
|
|
946
|
+
const items = [];
|
|
947
|
+
const ulComputed = window.getComputedStyle(el);
|
|
948
|
+
const ulPaddingLeftPt = pxToPoints(ulComputed.paddingLeft);
|
|
949
|
+
|
|
950
|
+
// Split: margin-left for bullet position, indent for text position
|
|
951
|
+
// margin-left + indent = ul padding-left
|
|
952
|
+
const marginLeft = ulPaddingLeftPt * 0.5;
|
|
953
|
+
const textIndent = ulPaddingLeftPt * 0.5;
|
|
954
|
+
|
|
955
|
+
liElements.forEach((li, idx) => {
|
|
956
|
+
const isLast = idx === liElements.length - 1;
|
|
957
|
+
const runs = parseInlineFormatting(li, { breakLine: false });
|
|
958
|
+
// Clean manual bullets from first run
|
|
959
|
+
if (runs.length > 0) {
|
|
960
|
+
runs[0].text = runs[0].text.replace(/^[•\-\*▪▸]\s*/, '');
|
|
961
|
+
runs[0].options.bullet = { indent: textIndent };
|
|
962
|
+
}
|
|
963
|
+
// Set breakLine on last run
|
|
964
|
+
if (runs.length > 0 && !isLast) {
|
|
965
|
+
runs[runs.length - 1].options.breakLine = true;
|
|
966
|
+
}
|
|
967
|
+
items.push(...runs);
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
const computed = window.getComputedStyle(liElements[0] || el);
|
|
971
|
+
|
|
972
|
+
elements.push({
|
|
973
|
+
type: 'list',
|
|
974
|
+
items: items,
|
|
975
|
+
position: {
|
|
976
|
+
x: pxToInch(rect.left),
|
|
977
|
+
y: pxToInch(rect.top),
|
|
978
|
+
w: pxToInch(rect.width),
|
|
979
|
+
h: pxToInch(rect.height)
|
|
980
|
+
},
|
|
981
|
+
style: {
|
|
982
|
+
fontSize: pxToPoints(computed.fontSize),
|
|
983
|
+
fontFace: computed.fontFamily.split(',')[0].replace(/['"]/g, '').trim(),
|
|
984
|
+
color: rgbToHex(computed.color),
|
|
985
|
+
transparency: extractAlpha(computed.color),
|
|
986
|
+
align: computed.textAlign === 'start' ? 'left' : computed.textAlign,
|
|
987
|
+
lineSpacing: computed.lineHeight && computed.lineHeight !== 'normal' ? pxToPoints(computed.lineHeight) : null,
|
|
988
|
+
paraSpaceBefore: 0,
|
|
989
|
+
paraSpaceAfter: pxToPoints(computed.marginBottom),
|
|
990
|
+
// PptxGenJS margin array is [left, right, bottom, top]
|
|
991
|
+
margin: [marginLeft, 0, 0, 0]
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
liElements.forEach(li => processed.add(li));
|
|
996
|
+
processed.add(el);
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
// Extract text elements (P, H1, H2, etc.)
|
|
1001
|
+
if (!textTags.includes(el.tagName)) return;
|
|
1002
|
+
|
|
1003
|
+
const rect = el.getBoundingClientRect();
|
|
1004
|
+
const text = el.textContent.trim();
|
|
1005
|
+
if (rect.width === 0 || rect.height === 0 || !text) return;
|
|
1006
|
+
|
|
1007
|
+
// Validate: Check for manual bullet symbols in text elements (not in lists)
|
|
1008
|
+
if (el.tagName !== 'LI' && /^[•\-\*▪▸○●◆◇■□]\s/.test(text.trimStart())) {
|
|
1009
|
+
errors.push(
|
|
1010
|
+
`Text element <${el.tagName.toLowerCase()}> starts with bullet symbol "${text.substring(0, 20)}...". ` +
|
|
1011
|
+
'Use <ul> or <ol> lists instead of manual bullet symbols.'
|
|
1012
|
+
);
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
const computed = window.getComputedStyle(el);
|
|
1017
|
+
const rotation = getRotation(computed.transform, computed.writingMode);
|
|
1018
|
+
const { x, y, w, h } = getPositionAndSize(el, rect, rotation);
|
|
1019
|
+
|
|
1020
|
+
const baseStyle = {
|
|
1021
|
+
fontSize: pxToPoints(computed.fontSize),
|
|
1022
|
+
fontFace: computed.fontFamily.split(',')[0].replace(/['"]/g, '').trim(),
|
|
1023
|
+
color: rgbToHex(computed.color),
|
|
1024
|
+
align: computed.textAlign === 'start' ? 'left' : computed.textAlign,
|
|
1025
|
+
lineSpacing: pxToPoints(computed.lineHeight),
|
|
1026
|
+
paraSpaceBefore: pxToPoints(computed.marginTop),
|
|
1027
|
+
paraSpaceAfter: pxToPoints(computed.marginBottom),
|
|
1028
|
+
// PptxGenJS margin array is [left, right, bottom, top] (not [top, right, bottom, left] as documented)
|
|
1029
|
+
margin: [
|
|
1030
|
+
pxToPoints(computed.paddingLeft),
|
|
1031
|
+
pxToPoints(computed.paddingRight),
|
|
1032
|
+
pxToPoints(computed.paddingBottom),
|
|
1033
|
+
pxToPoints(computed.paddingTop)
|
|
1034
|
+
]
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
const transparency = extractAlpha(computed.color);
|
|
1038
|
+
if (transparency !== null) baseStyle.transparency = transparency;
|
|
1039
|
+
|
|
1040
|
+
if (rotation !== null) baseStyle.rotate = rotation;
|
|
1041
|
+
|
|
1042
|
+
const hasFormatting = el.querySelector('b, i, u, strong, em, span, br');
|
|
1043
|
+
|
|
1044
|
+
if (hasFormatting) {
|
|
1045
|
+
// Text with inline formatting
|
|
1046
|
+
const transformStr = computed.textTransform;
|
|
1047
|
+
const runs = parseInlineFormatting(el, {}, [], (str) => applyTextTransform(str, transformStr));
|
|
1048
|
+
|
|
1049
|
+
// Adjust lineSpacing based on largest fontSize in runs
|
|
1050
|
+
const adjustedStyle = { ...baseStyle };
|
|
1051
|
+
if (adjustedStyle.lineSpacing) {
|
|
1052
|
+
const maxFontSize = Math.max(
|
|
1053
|
+
adjustedStyle.fontSize,
|
|
1054
|
+
...runs.map(r => r.options?.fontSize || 0)
|
|
1055
|
+
);
|
|
1056
|
+
if (maxFontSize > adjustedStyle.fontSize) {
|
|
1057
|
+
const lineHeightMultiplier = adjustedStyle.lineSpacing / adjustedStyle.fontSize;
|
|
1058
|
+
adjustedStyle.lineSpacing = maxFontSize * lineHeightMultiplier;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
elements.push({
|
|
1063
|
+
type: el.tagName.toLowerCase(),
|
|
1064
|
+
text: runs,
|
|
1065
|
+
position: { x: pxToInch(x), y: pxToInch(y), w: pxToInch(w), h: pxToInch(h) },
|
|
1066
|
+
style: adjustedStyle
|
|
1067
|
+
});
|
|
1068
|
+
} else {
|
|
1069
|
+
// Plain text - inherit CSS formatting
|
|
1070
|
+
const textTransform = computed.textTransform;
|
|
1071
|
+
const transformedText = applyTextTransform(text, textTransform);
|
|
1072
|
+
|
|
1073
|
+
const isBold = computed.fontWeight === 'bold' || parseInt(computed.fontWeight) >= 600;
|
|
1074
|
+
|
|
1075
|
+
elements.push({
|
|
1076
|
+
type: el.tagName.toLowerCase(),
|
|
1077
|
+
text: transformedText,
|
|
1078
|
+
position: { x: pxToInch(x), y: pxToInch(y), w: pxToInch(w), h: pxToInch(h) },
|
|
1079
|
+
style: {
|
|
1080
|
+
...baseStyle,
|
|
1081
|
+
bold: isBold && !shouldSkipBold(computed.fontFamily),
|
|
1082
|
+
italic: computed.fontStyle === 'italic',
|
|
1083
|
+
underline: computed.textDecoration.includes('underline')
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
processed.add(el);
|
|
1089
|
+
});
|
|
1090
|
+
|
|
1091
|
+
return { background, elements, placeholders, errors };
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
async function html2pptx(htmlFile, pres, options = {}) {
|
|
1096
|
+
const {
|
|
1097
|
+
tmpDir = process.env.TMPDIR || '/tmp',
|
|
1098
|
+
slide = null
|
|
1099
|
+
} = options;
|
|
1100
|
+
|
|
1101
|
+
try {
|
|
1102
|
+
// Use Chrome on macOS, default Chromium on Unix
|
|
1103
|
+
const launchOptions = { env: { TMPDIR: tmpDir } };
|
|
1104
|
+
if (process.platform === 'darwin') {
|
|
1105
|
+
launchOptions.channel = 'chrome';
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
const browser = await chromium.launch(launchOptions);
|
|
1109
|
+
|
|
1110
|
+
let bodyDimensions;
|
|
1111
|
+
let slideData;
|
|
1112
|
+
|
|
1113
|
+
const filePath = path.isAbsolute(htmlFile) ? htmlFile : path.join(process.cwd(), htmlFile);
|
|
1114
|
+
const validationErrors = [];
|
|
1115
|
+
|
|
1116
|
+
try {
|
|
1117
|
+
const page = await browser.newPage();
|
|
1118
|
+
page.on('console', (msg) => {
|
|
1119
|
+
// Log the message text to your test runner's console
|
|
1120
|
+
console.log(`Browser console: ${msg.text()}`);
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
await page.goto(`file://${filePath}`);
|
|
1124
|
+
|
|
1125
|
+
bodyDimensions = await getBodyDimensions(page);
|
|
1126
|
+
|
|
1127
|
+
await page.setViewportSize({
|
|
1128
|
+
width: Math.round(bodyDimensions.width),
|
|
1129
|
+
height: Math.round(bodyDimensions.height)
|
|
1130
|
+
});
|
|
1131
|
+
|
|
1132
|
+
slideData = await extractSlideData(page);
|
|
1133
|
+
} finally {
|
|
1134
|
+
await browser.close();
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// Collect all validation errors
|
|
1138
|
+
if (bodyDimensions.errors && bodyDimensions.errors.length > 0) {
|
|
1139
|
+
validationErrors.push(...bodyDimensions.errors);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
const dimensionErrors = validateDimensions(bodyDimensions, pres);
|
|
1143
|
+
if (dimensionErrors.length > 0) {
|
|
1144
|
+
validationErrors.push(...dimensionErrors);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
const textBoxPositionErrors = validateTextBoxPosition(slideData, bodyDimensions);
|
|
1148
|
+
if (textBoxPositionErrors.length > 0) {
|
|
1149
|
+
validationErrors.push(...textBoxPositionErrors);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
if (slideData.errors && slideData.errors.length > 0) {
|
|
1153
|
+
validationErrors.push(...slideData.errors);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
// Throw all errors at once if any exist
|
|
1157
|
+
if (validationErrors.length > 0) {
|
|
1158
|
+
const errorMessage = validationErrors.length === 1
|
|
1159
|
+
? validationErrors[0]
|
|
1160
|
+
: `Multiple validation errors found:\n${validationErrors.map((e, i) => ` ${i + 1}. ${e}`).join('\n')}`;
|
|
1161
|
+
throw new Error(errorMessage);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
const targetSlide = slide || pres.addSlide();
|
|
1165
|
+
|
|
1166
|
+
await addBackground(slideData, targetSlide, tmpDir);
|
|
1167
|
+
addElements(slideData, targetSlide, pres);
|
|
1168
|
+
|
|
1169
|
+
return { slide: targetSlide, placeholders: slideData.placeholders };
|
|
1170
|
+
} catch (error) {
|
|
1171
|
+
if (!error.message.startsWith(htmlFile)) {
|
|
1172
|
+
throw new Error(`${htmlFile}: ${error.message}`);
|
|
1173
|
+
}
|
|
1174
|
+
throw error;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
module.exports = html2pptx;
|