@cliangdev/conductor 0.51.0 → 0.53.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/assets/claude/agents/conductor-marketing-art-director.md +2 -1
- package/assets/claude/skills/conductor-marketing-create/SKILL.md +12 -2
- package/assets/claude/skills/conductor-marketing-create/references/capabilities.md +9 -2
- package/assets/claude/skills/conductor-marketing-create/references/direct.md +39 -6
- package/assets/claude/skills/conductor-marketing-create/references/platform-specs.md +15 -4
- package/assets/claude/skills/conductor-marketing-create/references/shotlist-template.md +2 -2
- package/assets/claude/skills/conductor-marketing-create/references/slideshow-formats.md +2 -1
- package/assets/claude/skills/conductor-marketing-create/references/team-run.md +3 -3
- package/assets/claude/skills/conductor-marketing-report/SKILL.md +2 -2
- package/assets/cli-manifest.json +261 -23
- package/dist/creative/assertions.js +30 -3
- package/dist/creative/frame.js +2 -2
- package/dist/creative/job/media.mjs +2 -2
- package/dist/creative/job/render.mjs +3 -0
- package/dist/creative/placements.js +2 -2
- package/dist/creative/placements.json +3 -3
- package/dist/creative/render.js +20 -8
- package/dist/lib/creative-render.d.ts +14 -1
- package/dist/lib/creative-render.d.ts.map +1 -1
- package/dist/lib/creative-render.js +3 -1
- package/dist/lib/creative-render.js.map +1 -1
- package/dist/lib/safe-zone/check.d.ts +31 -0
- package/dist/lib/safe-zone/check.d.ts.map +1 -0
- package/dist/lib/safe-zone/check.js +267 -0
- package/dist/lib/safe-zone/check.js.map +1 -0
- package/dist/lib/safe-zone/frames.d.ts +35 -0
- package/dist/lib/safe-zone/frames.d.ts.map +1 -0
- package/dist/lib/safe-zone/frames.js +132 -0
- package/dist/lib/safe-zone/frames.js.map +1 -0
- package/dist/lib/safe-zone/ocr.d.ts +42 -0
- package/dist/lib/safe-zone/ocr.d.ts.map +1 -0
- package/dist/lib/safe-zone/ocr.js +139 -0
- package/dist/lib/safe-zone/ocr.js.map +1 -0
- package/dist/lib/safe-zone/overlay.d.ts +59 -0
- package/dist/lib/safe-zone/overlay.d.ts.map +1 -0
- package/dist/lib/safe-zone/overlay.js +283 -0
- package/dist/lib/safe-zone/overlay.js.map +1 -0
- package/dist/lib/safe-zone/zones.d.ts +46 -0
- package/dist/lib/safe-zone/zones.d.ts.map +1 -0
- package/dist/lib/safe-zone/zones.js +84 -0
- package/dist/lib/safe-zone/zones.js.map +1 -0
- package/dist/lib/slideshow/compose.d.ts +2 -0
- package/dist/lib/slideshow/compose.d.ts.map +1 -1
- package/dist/lib/slideshow/compose.js +1 -1
- package/dist/lib/slideshow/compose.js.map +1 -1
- package/dist/lib/slideshow/css.d.ts +2 -0
- package/dist/lib/slideshow/css.d.ts.map +1 -1
- package/dist/lib/slideshow/css.js +9 -5
- package/dist/lib/slideshow/css.js.map +1 -1
- package/dist/lib/slideshow/html.d.ts +12 -3
- package/dist/lib/slideshow/html.d.ts.map +1 -1
- package/dist/lib/slideshow/html.js +16 -10
- package/dist/lib/slideshow/html.js.map +1 -1
- package/dist/lib/slideshow/spec-transport.d.ts.map +1 -1
- package/dist/lib/slideshow/spec-transport.js +4 -2
- package/dist/lib/slideshow/spec-transport.js.map +1 -1
- package/dist/lib/slideshow/spec.d.ts +8 -0
- package/dist/lib/slideshow/spec.d.ts.map +1 -1
- package/dist/lib/slideshow/spec.js +6 -0
- package/dist/lib/slideshow/spec.js.map +1 -1
- package/dist/lib/slideshow-pacing.d.ts +46 -0
- package/dist/lib/slideshow-pacing.d.ts.map +1 -0
- package/dist/lib/slideshow-pacing.js +98 -0
- package/dist/lib/slideshow-pacing.js.map +1 -0
- package/dist/mcp/index.d.ts +12023 -800
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +593 -13
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools/ai-visibility.d.ts +18 -0
- package/dist/mcp/tools/ai-visibility.d.ts.map +1 -0
- package/dist/mcp/tools/ai-visibility.js +124 -0
- package/dist/mcp/tools/ai-visibility.js.map +1 -0
- package/dist/mcp/tools/budget.d.ts +35 -0
- package/dist/mcp/tools/budget.d.ts.map +1 -0
- package/dist/mcp/tools/budget.js +205 -0
- package/dist/mcp/tools/budget.js.map +1 -0
- package/dist/mcp/tools/creative-drafts.d.ts +16 -2
- package/dist/mcp/tools/creative-drafts.d.ts.map +1 -1
- package/dist/mcp/tools/creative-drafts.js +237 -31
- package/dist/mcp/tools/creative-drafts.js.map +1 -1
- package/dist/mcp/tools/creatives.d.ts +12 -3
- package/dist/mcp/tools/creatives.d.ts.map +1 -1
- package/dist/mcp/tools/creatives.js +235 -17
- package/dist/mcp/tools/creatives.js.map +1 -1
- package/dist/mcp/tools/creators.d.ts +15 -0
- package/dist/mcp/tools/creators.d.ts.map +1 -0
- package/dist/mcp/tools/creators.js +69 -0
- package/dist/mcp/tools/creators.js.map +1 -0
- package/dist/mcp/tools/growth-signals.d.ts +38 -0
- package/dist/mcp/tools/growth-signals.d.ts.map +1 -0
- package/dist/mcp/tools/growth-signals.js +135 -0
- package/dist/mcp/tools/growth-signals.js.map +1 -0
- package/dist/mcp/tools/insights.d.ts +9 -0
- package/dist/mcp/tools/insights.d.ts.map +1 -1
- package/dist/mcp/tools/insights.js +6 -1
- package/dist/mcp/tools/insights.js.map +1 -1
- package/dist/mcp/tools/links.d.ts +26 -0
- package/dist/mcp/tools/links.d.ts.map +1 -0
- package/dist/mcp/tools/links.js +92 -0
- package/dist/mcp/tools/links.js.map +1 -0
- package/dist/mcp/tools/marketing-changes.d.ts +25 -0
- package/dist/mcp/tools/marketing-changes.d.ts.map +1 -0
- package/dist/mcp/tools/marketing-changes.js +108 -0
- package/dist/mcp/tools/marketing-changes.js.map +1 -0
- package/dist/mcp/tools/marketing-definitions.d.ts +11 -0
- package/dist/mcp/tools/marketing-definitions.d.ts.map +1 -0
- package/dist/mcp/tools/marketing-definitions.js +37 -0
- package/dist/mcp/tools/marketing-definitions.js.map +1 -0
- package/dist/mcp/tools/marketing-report.d.ts +7 -0
- package/dist/mcp/tools/marketing-report.d.ts.map +1 -1
- package/dist/mcp/tools/marketing-report.js +43 -5
- package/dist/mcp/tools/marketing-report.js.map +1 -1
- package/dist/mcp/tools/posts.d.ts.map +1 -1
- package/dist/mcp/tools/posts.js +16 -0
- package/dist/mcp/tools/posts.js.map +1 -1
- package/dist/mcp/tools/promises.d.ts +39 -0
- package/dist/mcp/tools/promises.d.ts.map +1 -0
- package/dist/mcp/tools/promises.js +98 -0
- package/dist/mcp/tools/promises.js.map +1 -0
- package/dist/mcp/tools/proposals.d.ts +26 -0
- package/dist/mcp/tools/proposals.d.ts.map +1 -0
- package/dist/mcp/tools/proposals.js +102 -0
- package/dist/mcp/tools/proposals.js.map +1 -0
- package/dist/mcp/tools/safe-zone-pixels.d.ts +165 -0
- package/dist/mcp/tools/safe-zone-pixels.d.ts.map +1 -0
- package/dist/mcp/tools/safe-zone-pixels.js +300 -0
- package/dist/mcp/tools/safe-zone-pixels.js.map +1 -0
- package/dist/mcp/tools/slideshow-render.d.ts.map +1 -1
- package/dist/mcp/tools/slideshow-render.js +3 -1
- package/dist/mcp/tools/slideshow-render.js.map +1 -1
- package/dist/mcp/tools/switchback.d.ts +36 -0
- package/dist/mcp/tools/switchback.d.ts.map +1 -0
- package/dist/mcp/tools/switchback.js +123 -0
- package/dist/mcp/tools/switchback.js.map +1 -0
- package/dist/mcp/tools/verification.d.ts +24 -0
- package/dist/mcp/tools/verification.d.ts.map +1 -0
- package/dist/mcp/tools/verification.js +124 -0
- package/dist/mcp/tools/verification.js.map +1 -0
- package/package.json +4 -2
package/assets/cli-manifest.json
CHANGED
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
}
|
|
163
163
|
],
|
|
164
164
|
"claudeIntegration": {
|
|
165
|
-
"description": "Conductor ships a full Claude Code plugin
|
|
165
|
+
"description": "Conductor ships a full Claude Code plugin — slash commands, skills, and a background agent — installed automatically by conductor init into your Claude Code configuration.",
|
|
166
166
|
"mcpConfig": "{\n \"mcpServers\": {\n \"conductor\": {\n \"command\": \"conductor\",\n \"args\": [\"mcp\"]\n }\n }\n}",
|
|
167
167
|
"slashCommands": [
|
|
168
168
|
{
|
|
@@ -175,15 +175,15 @@
|
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
"name": "conductor:implement",
|
|
178
|
-
"description": "Take a PRD issue from BACKLOG to a green PR
|
|
178
|
+
"description": "Take a PRD issue from BACKLOG to a green PR — status transitions, branch, parallel coding agents, CI monitoring."
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
181
|
"name": "conductor:fix",
|
|
182
|
-
"description": "Fix a bug found during PR review
|
|
182
|
+
"description": "Fix a bug found during PR review — root cause investigation, full build validation, push to the existing PR branch."
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"name": "conductor:workflow",
|
|
186
|
-
"description": "Design and create a Conductor workflow
|
|
186
|
+
"description": "Design and create a Conductor workflow — YAML automation or statechart lifecycle — via guided discovery and MCP creation."
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
"name": "conductor:marketing",
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
},
|
|
381
381
|
{
|
|
382
382
|
"name": "write_document",
|
|
383
|
-
"description": "Create or update a Work Item document by filename with full content (upsert). Works headlessly
|
|
383
|
+
"description": "Create or update a Work Item document by filename with full content (upsert). Works headlessly — supersedes scaffold_document+Write for new documents.",
|
|
384
384
|
"category": "documents",
|
|
385
385
|
"requiredParams": [
|
|
386
386
|
"issueId",
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
},
|
|
409
409
|
{
|
|
410
410
|
"name": "list_workflows",
|
|
411
|
-
"description": "List the project's Workflows. Discovery entry point
|
|
411
|
+
"description": "List the project's Workflows. Discovery entry point — resolves workflow names to slugs before creating a Work Item.",
|
|
412
412
|
"category": "workflows"
|
|
413
413
|
},
|
|
414
414
|
{
|
|
@@ -470,7 +470,7 @@
|
|
|
470
470
|
},
|
|
471
471
|
{
|
|
472
472
|
"name": "update_workflow",
|
|
473
|
-
"description": "Update a DRAFT workflow definition. Fix validation errors before retrying publish
|
|
473
|
+
"description": "Update a DRAFT workflow definition. Fix validation errors before retrying publish — do not create a second workflow.",
|
|
474
474
|
"category": "workflows",
|
|
475
475
|
"requiredParams": [
|
|
476
476
|
"workflowId"
|
|
@@ -478,7 +478,7 @@
|
|
|
478
478
|
},
|
|
479
479
|
{
|
|
480
480
|
"name": "delete_workflow",
|
|
481
|
-
"description": "Delete a DRAFT workflow definition. PUBLISHED and DISABLED workflows are rejected
|
|
481
|
+
"description": "Delete a DRAFT workflow definition. PUBLISHED and DISABLED workflows are rejected — prefer update_workflow to fix a DRAFT in place.",
|
|
482
482
|
"category": "workflows",
|
|
483
483
|
"requiredParams": [
|
|
484
484
|
"workflowId"
|
|
@@ -528,7 +528,7 @@
|
|
|
528
528
|
},
|
|
529
529
|
{
|
|
530
530
|
"name": "list_workflow_secrets",
|
|
531
|
-
"description": "List the names of workflow secrets configured for this project (keys only
|
|
531
|
+
"description": "List the names of workflow secrets configured for this project (keys only — values are never returned over MCP).",
|
|
532
532
|
"category": "workflows"
|
|
533
533
|
},
|
|
534
534
|
{
|
|
@@ -562,7 +562,7 @@
|
|
|
562
562
|
},
|
|
563
563
|
{
|
|
564
564
|
"name": "update_agent",
|
|
565
|
-
"description": "Update an existing AI Agent. Partial
|
|
565
|
+
"description": "Update an existing AI Agent. Partial — only the supplied fields change. Also how an ACTIVE agent is set back to DRAFT so it can be deleted.",
|
|
566
566
|
"category": "discovery",
|
|
567
567
|
"requiredParams": [
|
|
568
568
|
"agentId"
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
},
|
|
571
571
|
{
|
|
572
572
|
"name": "delete_agent",
|
|
573
|
-
"description": "Delete a DRAFT AI Agent. An ACTIVE agent is rejected
|
|
573
|
+
"description": "Delete a DRAFT AI Agent. An ACTIVE agent is rejected — set it to DRAFT with update_agent first. Also rejected if a workflow still references this agent.",
|
|
574
574
|
"category": "discovery",
|
|
575
575
|
"requiredParams": [
|
|
576
576
|
"agentId"
|
|
@@ -631,7 +631,7 @@
|
|
|
631
631
|
},
|
|
632
632
|
{
|
|
633
633
|
"name": "list_knowledge_domains",
|
|
634
|
-
"description": "List this project's knowledge domains
|
|
634
|
+
"description": "List this project's knowledge domains — slug, displayName, description, pathPrefix, filing conventions.",
|
|
635
635
|
"category": "knowledge"
|
|
636
636
|
},
|
|
637
637
|
{
|
|
@@ -646,12 +646,12 @@
|
|
|
646
646
|
},
|
|
647
647
|
{
|
|
648
648
|
"name": "list_project_docs",
|
|
649
|
-
"description": "Map the project's Docs section
|
|
649
|
+
"description": "Map the project's Docs section — folder paths and every document as a \"Folder/Title\" path, or full-text search with query.",
|
|
650
650
|
"category": "project-docs"
|
|
651
651
|
},
|
|
652
652
|
{
|
|
653
653
|
"name": "read_project_doc",
|
|
654
|
-
"description": "Read one project document by path or docId
|
|
654
|
+
"description": "Read one project document by path or docId — full Markdown plus taskLines (every checkbox with its line number and state).",
|
|
655
655
|
"category": "project-docs"
|
|
656
656
|
},
|
|
657
657
|
{
|
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
},
|
|
702
702
|
{
|
|
703
703
|
"name": "respond_to_project_doc_comment",
|
|
704
|
-
"description": "Answer a comment thread on a project document
|
|
704
|
+
"description": "Answer a comment thread on a project document — reply, resolve, or both.",
|
|
705
705
|
"category": "project-docs",
|
|
706
706
|
"requiredParams": [
|
|
707
707
|
"commentId"
|
|
@@ -709,7 +709,7 @@
|
|
|
709
709
|
},
|
|
710
710
|
{
|
|
711
711
|
"name": "list_project_doc_versions",
|
|
712
|
-
"description": "List a project document's edit history
|
|
712
|
+
"description": "List a project document's edit history — version number, author and timestamp, newest first.",
|
|
713
713
|
"category": "project-docs"
|
|
714
714
|
},
|
|
715
715
|
{
|
|
@@ -793,7 +793,7 @@
|
|
|
793
793
|
},
|
|
794
794
|
{
|
|
795
795
|
"name": "list_assets",
|
|
796
|
-
"description": "Every Asset on a Work Item
|
|
796
|
+
"description": "Every Asset on a Work Item — uploaded media and recorded links, with the ids set_publish_targets takes.",
|
|
797
797
|
"category": "marketing",
|
|
798
798
|
"requiredParams": [
|
|
799
799
|
"issueId"
|
|
@@ -836,9 +836,49 @@
|
|
|
836
836
|
"category": "marketing",
|
|
837
837
|
"requiredParams": []
|
|
838
838
|
},
|
|
839
|
+
{
|
|
840
|
+
"name": "get_budget_pacing",
|
|
841
|
+
"description": "Paid spend against the month's budget cap per paid channel: month-to-date spend, pace, projected month-end, compliance (a paid channel needs a stop rule), tripped stop rules and marginal cost per install.",
|
|
842
|
+
"category": "marketing",
|
|
843
|
+
"requiredParams": []
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"name": "set_marketing_budget",
|
|
847
|
+
"description": "Set the paid budget cap for a month. Records the cap only; it changes nothing on an ad platform.",
|
|
848
|
+
"category": "marketing",
|
|
849
|
+
"requiredParams": [
|
|
850
|
+
"month",
|
|
851
|
+
"capAmount"
|
|
852
|
+
]
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
"name": "set_stop_rule",
|
|
856
|
+
"description": "Add a stop rule for a paid channel (metric, comparator, threshold, minimum sample, window). Conductor evaluates and records it; a human applies any bid or budget change.",
|
|
857
|
+
"category": "marketing",
|
|
858
|
+
"requiredParams": [
|
|
859
|
+
"channel",
|
|
860
|
+
"metric",
|
|
861
|
+
"comparator",
|
|
862
|
+
"threshold"
|
|
863
|
+
]
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"name": "remove_stop_rule",
|
|
867
|
+
"description": "Remove a stop rule by id.",
|
|
868
|
+
"category": "marketing",
|
|
869
|
+
"requiredParams": [
|
|
870
|
+
"ruleId"
|
|
871
|
+
]
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"name": "get_marketing_definitions",
|
|
875
|
+
"description": "What each marketing metric counts: source report or field, numerator and denominator, source type, exclusions and time zone. Optionally one channel.",
|
|
876
|
+
"category": "marketing",
|
|
877
|
+
"requiredParams": []
|
|
878
|
+
},
|
|
839
879
|
{
|
|
840
880
|
"name": "get_marketing_report",
|
|
841
|
-
"description": "The whole-funnel marketing report in one payload: sources, headline metrics, acquisition by source, funnel with its biggest drop, daily chart data, scorecard, keywords, ads, benchmarks and changes. Window 7d or 28d.",
|
|
881
|
+
"description": "The whole-funnel marketing report in one payload: sources, headline metrics, acquisition by source, funnel with its biggest drop, daily chart data, scorecard, keywords with cost per outcome, payback, exclusions, ASO keywords, email, shares and tracked-link rows, a verification tally, ads, benchmarks and changes. Window 7d or 28d.",
|
|
842
882
|
"category": "marketing",
|
|
843
883
|
"requiredParams": []
|
|
844
884
|
},
|
|
@@ -862,6 +902,204 @@
|
|
|
862
902
|
"metricRef"
|
|
863
903
|
]
|
|
864
904
|
},
|
|
905
|
+
{
|
|
906
|
+
"name": "get_verification_ledger",
|
|
907
|
+
"description": "Which marketing numbers to trust: per metric, Conductor's value, the product backend's, the latest direct platform read and a verdict (BOTH, CONNECTOR, BACKEND, PLATFORM or UNCHECKED). Optional window, channel and only-problems filter.",
|
|
908
|
+
"category": "marketing",
|
|
909
|
+
"requiredParams": []
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
"name": "record_platform_read",
|
|
913
|
+
"description": "Log what a platform's own UI or API shows for one metric over an exact day range. Append-only; returns the metric's row with its verdict.",
|
|
914
|
+
"category": "marketing",
|
|
915
|
+
"requiredParams": [
|
|
916
|
+
"channel",
|
|
917
|
+
"metric",
|
|
918
|
+
"from",
|
|
919
|
+
"to",
|
|
920
|
+
"value",
|
|
921
|
+
"sourceName"
|
|
922
|
+
]
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"name": "propose_marketing_change",
|
|
926
|
+
"description": "Propose one marketing change with exactly two ledger-verified signals as a PLANNED change with a review date. Refuses unverified evidence and more than 3 a week; a person approves every change and moves it to LIVE.",
|
|
927
|
+
"category": "marketing",
|
|
928
|
+
"requiredParams": [
|
|
929
|
+
"title",
|
|
930
|
+
"type",
|
|
931
|
+
"hypothesis",
|
|
932
|
+
"reviewOn",
|
|
933
|
+
"signals"
|
|
934
|
+
]
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"name": "install_weekly_growth_workflow",
|
|
938
|
+
"description": "Install the Weekly growth review workflow from the template, disabled (Admin; safe to repeat). It needs a runtime target for Claude Code steps and a person to enable it.",
|
|
939
|
+
"category": "marketing",
|
|
940
|
+
"requiredParams": []
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"name": "get_growth_signals",
|
|
944
|
+
"description": "Growth signals from public data: seasonal moments with overdue warnings, weekly ratings growth, recent reviews, competitor listing changes and keyword positions.",
|
|
945
|
+
"category": "marketing",
|
|
946
|
+
"requiredParams": []
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
"name": "set_marketing_moment",
|
|
950
|
+
"description": "Record a dated moment (e.g. Thanksgiving) and the surfaces that must change for it, each with a due date. A surface past due with no linked change warns.",
|
|
951
|
+
"category": "marketing",
|
|
952
|
+
"requiredParams": [
|
|
953
|
+
"key",
|
|
954
|
+
"name",
|
|
955
|
+
"date",
|
|
956
|
+
"surfaces"
|
|
957
|
+
]
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"name": "link_moment_change",
|
|
961
|
+
"description": "Link the marketing change Work Item that handled a moment surface, which clears its warning.",
|
|
962
|
+
"category": "marketing",
|
|
963
|
+
"requiredParams": [
|
|
964
|
+
"key",
|
|
965
|
+
"surfaceId",
|
|
966
|
+
"workItemId"
|
|
967
|
+
]
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
"name": "add_competitor",
|
|
971
|
+
"description": "Watch a competitor app's public App Store listing, ratings, reviews and keyword positions each week.",
|
|
972
|
+
"category": "marketing",
|
|
973
|
+
"requiredParams": [
|
|
974
|
+
"appId",
|
|
975
|
+
"name"
|
|
976
|
+
]
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
"name": "remove_competitor",
|
|
980
|
+
"description": "Stop watching a competitor app; its history is kept.",
|
|
981
|
+
"category": "marketing",
|
|
982
|
+
"requiredParams": [
|
|
983
|
+
"appId"
|
|
984
|
+
]
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
"name": "set_tracked_keywords",
|
|
988
|
+
"description": "Replace the App Store keywords whose search position is recorded weekly for our app and each competitor.",
|
|
989
|
+
"category": "marketing",
|
|
990
|
+
"requiredParams": [
|
|
991
|
+
"keywords"
|
|
992
|
+
]
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"name": "get_ai_visibility",
|
|
996
|
+
"description": "Whether AI assistants name the brand for a fixed set of questions, checked weekly: per question and assistant the latest answer and a weekly trend. An assistant with no provider key is skipped, never shown as not named.",
|
|
997
|
+
"category": "marketing",
|
|
998
|
+
"requiredParams": []
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
"name": "set_ai_questions",
|
|
1002
|
+
"description": "Replace the questions put to the AI assistants each week, and optionally the brand terms that count as naming the brand.",
|
|
1003
|
+
"category": "marketing",
|
|
1004
|
+
"requiredParams": [
|
|
1005
|
+
"questions"
|
|
1006
|
+
]
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
"name": "run_ai_visibility_check",
|
|
1010
|
+
"description": "Run this week's AI-assistant checks now with the workspace's own provider keys (Admin; at most 20 calls a week, safe to repeat).",
|
|
1011
|
+
"category": "marketing",
|
|
1012
|
+
"requiredParams": []
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"name": "create_switchback_test",
|
|
1016
|
+
"description": "Declare a weekly on/off test of one Apple Ads keyword (weeks, decision rule and minimum n fixed up front) to see whether paid adds installs or only relabels organic ones. A person applies the switch; the test settles itself.",
|
|
1017
|
+
"category": "marketing",
|
|
1018
|
+
"requiredParams": [
|
|
1019
|
+
"name",
|
|
1020
|
+
"keywordId",
|
|
1021
|
+
"keywordText"
|
|
1022
|
+
]
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"name": "start_switchback_test",
|
|
1026
|
+
"description": "Start a drafted switchback test: its weeks and rule are frozen and it settles itself into a reviewed change once the last week has ended and the data is settled.",
|
|
1027
|
+
"category": "marketing",
|
|
1028
|
+
"requiredParams": [
|
|
1029
|
+
"id"
|
|
1030
|
+
]
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
"name": "get_switchback_test",
|
|
1034
|
+
"description": "One switchback test: plan, rule, the state the keyword should be in this week, and once settled the verdict, per-week figures, n reached and the change that records it.",
|
|
1035
|
+
"category": "marketing",
|
|
1036
|
+
"requiredParams": [
|
|
1037
|
+
"id"
|
|
1038
|
+
]
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
"name": "list_switchback_tests",
|
|
1042
|
+
"description": "The workspace's switchback tests with status, this week's state and any verdict.",
|
|
1043
|
+
"category": "marketing",
|
|
1044
|
+
"requiredParams": []
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
"name": "import_marketing_changes",
|
|
1048
|
+
"description": "Import a marketing change log from a local JSONL file as Changes on the MARKETING_CHANGES workflow. Reference records are skipped, an unknown status or verdict refuses that record, and re-running skips what was already imported.",
|
|
1049
|
+
"category": "marketing",
|
|
1050
|
+
"requiredParams": [
|
|
1051
|
+
"filePath"
|
|
1052
|
+
]
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
"name": "get_creator_results",
|
|
1056
|
+
"description": "What one creator has produced: its posts with views, the downloads of its campaign links and the redemptions of its offer code over a window of settled days. An unknown figure is null with a note, never 0.",
|
|
1057
|
+
"category": "marketing",
|
|
1058
|
+
"requiredParams": [
|
|
1059
|
+
"creatorId"
|
|
1060
|
+
]
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
"name": "create_tracked_link",
|
|
1064
|
+
"description": "Create an App Store campaign link (pt/ct) for a bio, creator, email or other place and return its url. Every new Post already gets one automatically. Tokens roll up by family past Apple's reporting threshold.",
|
|
1065
|
+
"category": "marketing",
|
|
1066
|
+
"requiredParams": [
|
|
1067
|
+
"kind",
|
|
1068
|
+
"family",
|
|
1069
|
+
"token"
|
|
1070
|
+
]
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"name": "list_tracked_links",
|
|
1074
|
+
"description": "List tracked App Store links with their urls. Optionally add downloads and views per family; a family Apple reported nothing for reads below the threshold, never 0.",
|
|
1075
|
+
"category": "marketing",
|
|
1076
|
+
"requiredParams": []
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
"name": "tag_message",
|
|
1080
|
+
"description": "Tag a keyword, product page, Post, creative or paywall headline with the message it makes, so the promise ledger can join it to installs, intent picks, trial rate and D7. A target carries one message; tagging it again moves it.",
|
|
1081
|
+
"category": "marketing",
|
|
1082
|
+
"requiredParams": [
|
|
1083
|
+
"message",
|
|
1084
|
+
"targetKind",
|
|
1085
|
+
"targetRef"
|
|
1086
|
+
]
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"name": "untag_message",
|
|
1090
|
+
"description": "Remove the message from a target. Safe to repeat.",
|
|
1091
|
+
"category": "marketing",
|
|
1092
|
+
"requiredParams": [
|
|
1093
|
+
"targetKind",
|
|
1094
|
+
"targetRef"
|
|
1095
|
+
]
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"name": "list_promises",
|
|
1099
|
+
"description": "The promise ledger: per message, installs, intent mix, trial rate and D7 with 95% ranges and n, flagged as a small sample under 20. A figure with no data is null, never 0.",
|
|
1100
|
+
"category": "marketing",
|
|
1101
|
+
"requiredParams": []
|
|
1102
|
+
},
|
|
865
1103
|
{
|
|
866
1104
|
"name": "submit_review",
|
|
867
1105
|
"description": "Record an approve / request_changes verdict on a Post as this API key's user (an assigned REVIEWER). Approval schedules the Post.",
|
|
@@ -966,12 +1204,12 @@
|
|
|
966
1204
|
},
|
|
967
1205
|
{
|
|
968
1206
|
"name": "upload_creative_photo",
|
|
969
|
-
"description": "Deprecated alias for upload_creative_media
|
|
1207
|
+
"description": "Deprecated alias for upload_creative_media — same behavior, including for video/audio.",
|
|
970
1208
|
"category": "marketing"
|
|
971
1209
|
},
|
|
972
1210
|
{
|
|
973
1211
|
"name": "render_creative",
|
|
974
|
-
"description": "Render a Creative locally to upload-ready frames (JPEG per placement; MP4 for MOTION, a CAROUSEL with a track, or a CLIP with new audio, encoded with ffmpeg here), or a contact sheet with previewOnly. Runs synchronously and returns the render id, state and frame URLs.",
|
|
1212
|
+
"description": "Render a Creative locally to upload-ready frames (JPEG per placement; MP4 for MOTION, a CAROUSEL with a track, or a CLIP with new audio, encoded with ffmpeg here), or a contact sheet with previewOnly. Runs synchronously and returns the render id, state and frame URLs. A CAROUSEL or CLIP with a 9x16 placement also reports checks for text under the platform UI (reported only, never blocking).",
|
|
975
1213
|
"category": "marketing",
|
|
976
1214
|
"requiredParams": [
|
|
977
1215
|
"creativeId"
|
|
@@ -979,7 +1217,7 @@
|
|
|
979
1217
|
},
|
|
980
1218
|
{
|
|
981
1219
|
"name": "preview_creative",
|
|
982
|
-
"description": "Look at a Creative: returns its latest contact sheet as an image, rendering a fresh preview first if none exists yet.",
|
|
1220
|
+
"description": "Look at a Creative: returns its latest contact sheet as an image, rendering a fresh preview first if none exists yet. A saved CAROUSEL or CLIP with a 9x16 placement is also checked for text under the platform UI (checks, passed) and gets Instagram/TikTok UI overlay sheets on disk.",
|
|
983
1221
|
"category": "marketing",
|
|
984
1222
|
"requiredParams": [
|
|
985
1223
|
"creativeId"
|
|
@@ -1026,7 +1264,7 @@
|
|
|
1026
1264
|
},
|
|
1027
1265
|
{
|
|
1028
1266
|
"name": "preview_creative_draft",
|
|
1029
|
-
"description": "Look at a Creative before anything is saved: renders a draft locally from the create_creative fields plus local files (photoPath, clipPath, audioPath) and returns the contact sheet as an image; a CAROUSEL with a track also renders its slideshow MP4 and returns the path. Never writes to Conductor; commit only after the person approves.",
|
|
1267
|
+
"description": "Look at a Creative before anything is saved: renders a draft locally from the create_creative fields plus local files (photoPath, clipPath, audioPath) and returns the contact sheet as an image; a CAROUSEL with a track also renders its slideshow MP4 and returns the path, timing each slide from its text when slideDurations is omitted. Finished 9:16 slides and CLIP videos (clipPath or clipPaths, no commit) are checked for text under the platform UI (checks, passed) and shown with the Instagram UI drawn over them (overlaySheets, uiOverlay). Never writes to Conductor; commit only after the person approves.",
|
|
1030
1268
|
"category": "marketing"
|
|
1031
1269
|
},
|
|
1032
1270
|
{
|
|
@@ -1039,7 +1277,7 @@
|
|
|
1039
1277
|
},
|
|
1040
1278
|
{
|
|
1041
1279
|
"name": "attach_creative_to_post",
|
|
1042
|
-
"description": "Attach a Creative's rendered frames to a Post as its media, placement to platform, for every destination without its own custom media. A CAROUSEL with a track is sent per target as photos or its slideshow video (carouselAs). Call get_post_status (postId) to verify.",
|
|
1280
|
+
"description": "Attach a Creative's rendered frames to a Post as its media, placement to platform, for every destination without its own custom media. A CAROUSEL with a track is sent per target as photos or its slideshow video (carouselAs). A CAROUSEL or CLIP with text under the platform UI is refused (SAFE_ZONE_TEXT) unless ignoreSafeZone is true. Call get_post_status (postId) to verify.",
|
|
1043
1281
|
"category": "marketing",
|
|
1044
1282
|
"requiredParams": [
|
|
1045
1283
|
"creativeId",
|
|
@@ -77,8 +77,9 @@ export function spillDetect(boardRect, nodes) {
|
|
|
77
77
|
/** Copy intruding on the placement's reserved bottom safe zone (where a
|
|
78
78
|
* platform's own UI — Instagram's story CTA, TikTok's caption — sits).
|
|
79
79
|
* Mirrors render.js's own `fits()` bottom check exactly, so fitting and this
|
|
80
|
-
* safety net can never disagree.
|
|
81
|
-
*
|
|
80
|
+
* safety net can never disagree. The top zone is checked by
|
|
81
|
+
* `safeZoneTopIntrusion` below; the right column is not asserted (copy boxes
|
|
82
|
+
* span the full padded width, so a box test would always trip). */
|
|
82
83
|
export function safeZoneIntrusion(boardRect, nodes, safe) {
|
|
83
84
|
const issues = [];
|
|
84
85
|
const bottom = (safe && safe.bottom) || 0;
|
|
@@ -90,6 +91,29 @@ export function safeZoneIntrusion(boardRect, nodes, safe) {
|
|
|
90
91
|
return issues;
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
/** Text intruding on the placement's reserved top safe zone (Instagram's Reels
|
|
95
|
+
* header, TikTok's tabs and search): headline, body and CTA starting inside it.
|
|
96
|
+
* The lockup (logo) is not text and is never checked. `ratio` names the
|
|
97
|
+
* placement in the message. `severity: 'warning'` reports the findings as
|
|
98
|
+
* warnings (saved Creatives that rendered before the zone grew must keep
|
|
99
|
+
* rendering). Returns `{ errors, warnings }` message arrays. Mirrors
|
|
100
|
+
* render.js's `fits()` top check. */
|
|
101
|
+
export function safeZoneTopIntrusion(boardRect, nodes, safe, ratio, severity = 'error') {
|
|
102
|
+
const out = { errors: [], warnings: [] };
|
|
103
|
+
const top = (safe && safe.top) || 0;
|
|
104
|
+
if (!top) return out;
|
|
105
|
+
const h = Math.round(boardRect.bottom - boardRect.top);
|
|
106
|
+
const w = Math.round(boardRect.right - boardRect.left);
|
|
107
|
+
for (const { name, rect } of nodes) {
|
|
108
|
+
if (String(name).includes('cc-lockup')) continue;
|
|
109
|
+
const over = boardRect.top + top - rect.top;
|
|
110
|
+
if (over <= 1) continue;
|
|
111
|
+
const msg = `${name} starts ${Math.round(over)}px inside the top safe zone of ${ratio || 'this placement'} (platform UI covers y < ${top}); move it below y=${top} at ${w || 1080}x${h || 1920}`;
|
|
112
|
+
(severity === 'warning' ? out.warnings : out.errors).push(msg);
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
|
|
93
117
|
/** Pure: what a render requires on the board, from the resolved ad and the brand kit it renders with —
|
|
94
118
|
* `{ photo, lockup, headline }`. A photo is required when the ad has a photo URL (a clip-only background
|
|
95
119
|
* does not need one); a lockup when the kit has a mark or a wordmark (a kit without logos renders none,
|
|
@@ -136,7 +160,7 @@ function sameRgb(a, b) {
|
|
|
136
160
|
* to renderBoard; `expect` (optional, see expectedElements) names the elements the spec requires, so a
|
|
137
161
|
* missing one fails. An empty `errors` array means the frame is safe to ship; `warnings` are non-fatal
|
|
138
162
|
* (e.g. a soft, upscaled photo, or a body line the layout drops at this placement). */
|
|
139
|
-
export async function runAssertions(board, placement, brand, { outputScale = 2, expect = null } = {}) {
|
|
163
|
+
export async function runAssertions(board, placement, brand, { outputScale = 2, expect = null, safeTopSeverity = 'warning' } = {}) {
|
|
140
164
|
const errors = [];
|
|
141
165
|
const warnings = [];
|
|
142
166
|
// The same findings with a stable `rule` id each, for callers (the draft preview) that report them
|
|
@@ -164,6 +188,9 @@ export async function runAssertions(board, placement, brand, { outputScale = 2,
|
|
|
164
188
|
};
|
|
165
189
|
const intrusion = safeZoneIntrusion(br, nodes, safe);
|
|
166
190
|
if (intrusion.length) fail('safeZone', `safe-zone intrusion: ${intrusion.join('; ')}`);
|
|
191
|
+
const topZone = safeZoneTopIntrusion(br, nodes, safe, board.dataset.ratio, safeTopSeverity === 'error' ? 'error' : 'warning');
|
|
192
|
+
if (topZone.errors.length) fail('safeZone', `safe-zone intrusion: ${topZone.errors.join('; ')}`);
|
|
193
|
+
if (topZone.warnings.length) warn('safeZone', `safe-zone intrusion: ${topZone.warnings.join('; ')}`);
|
|
167
194
|
|
|
168
195
|
if (brand && brand.fontFamily) {
|
|
169
196
|
const headlineEl = board.querySelector('.cc-headline');
|
package/dist/creative/frame.js
CHANGED
|
@@ -105,13 +105,13 @@ async function main() {
|
|
|
105
105
|
return true;
|
|
106
106
|
};
|
|
107
107
|
// A motion frame is captured at 1x (video), so the photo only needs to cover the placement itself.
|
|
108
|
-
window.__assertBoard = async () => runAssertions(board, placement, spec.brand || {}, { outputScale: 1, expect });
|
|
108
|
+
window.__assertBoard = async () => runAssertions(board, placement, spec.brand || {}, { outputScale: 1, expect, safeTopSeverity: spec.safeTopSeverity });
|
|
109
109
|
|
|
110
110
|
finish({ ok: true, width: placement.w, height: placement.h });
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
const { errors, warnings, checks, width, height } = await runAssertions(board, placement, spec.brand || {}, { expect });
|
|
114
|
+
const { errors, warnings, checks, width, height } = await runAssertions(board, placement, spec.brand || {}, { expect, safeTopSeverity: spec.safeTopSeverity });
|
|
115
115
|
finish({ ok: errors.length === 0, errors, warnings, checks, width, height });
|
|
116
116
|
} catch (err) {
|
|
117
117
|
finish({ ok: false, error: String((err && err.message) || err) });
|
|
@@ -122,11 +122,11 @@ const COLOR_TAGS = ['-color_range', 'tv', '-colorspace', 'bt709', '-color_primar
|
|
|
122
122
|
const VIDEO_ENCODE = ['-c:v', 'libx264', '-preset', 'veryfast', '-crf', '20', '-pix_fmt', 'yuv420p'];
|
|
123
123
|
const AUDIO_ENCODE = ['-c:a', 'aac', '-b:a', '128k', '-ar', '48000', '-ac', '2'];
|
|
124
124
|
|
|
125
|
-
/** Per-slide durations resolved against the slide count: given values win; defaults are 3.
|
|
125
|
+
/** Per-slide durations resolved against the slide count: given values win; defaults are 3.5 s first, 3.0 s after. */
|
|
126
126
|
export function resolveSlideDurations(slideDurations, count) {
|
|
127
127
|
return Array.from({ length: count }, (_, i) => {
|
|
128
128
|
const d = slideDurations && slideDurations[i];
|
|
129
|
-
return d != null ? d : (i === 0 ? 3.
|
|
129
|
+
return d != null ? d : (i === 0 ? 3.5 : 3.0);
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -148,6 +148,7 @@ async function renderMotionPlacement({ browser, origin, spec, placementKey, ffmp
|
|
|
148
148
|
}, {
|
|
149
149
|
creative: spec.creative,
|
|
150
150
|
brand: spec.brand,
|
|
151
|
+
safeTopSeverity: spec.safeTopSeverity,
|
|
151
152
|
placementKey,
|
|
152
153
|
motion: spec.creative.motion,
|
|
153
154
|
time: 0,
|
|
@@ -425,6 +426,7 @@ async function checkFrame({ browser, origin, spec, frame, fps, log }) {
|
|
|
425
426
|
}, {
|
|
426
427
|
creative: spec.creative,
|
|
427
428
|
brand: spec.brand,
|
|
429
|
+
safeTopSeverity: spec.safeTopSeverity,
|
|
428
430
|
placementKey: frame.placementKey,
|
|
429
431
|
sequenceIndex: frame.index,
|
|
430
432
|
...(isMotion ? { motion, time: 0, clipStartSec: spec.creative.clipStartSec } : {}),
|
|
@@ -556,6 +558,7 @@ export async function run({ transport, packageRoot = PACKAGE_ROOT, browserFactor
|
|
|
556
558
|
}, {
|
|
557
559
|
creative: spec.creative,
|
|
558
560
|
brand: spec.brand,
|
|
561
|
+
safeTopSeverity: spec.safeTopSeverity,
|
|
559
562
|
placementKey: frame.placementKey,
|
|
560
563
|
sequenceIndex: frame.index,
|
|
561
564
|
placementKeys: spec.placements,
|
|
@@ -19,7 +19,7 @@ export const placements = {
|
|
|
19
19
|
label: '9:16 TikTok and Reels',
|
|
20
20
|
platform: 'tiktok',
|
|
21
21
|
default: true,
|
|
22
|
-
safe: { top:
|
|
22
|
+
safe: { top: 290, bottom: 430, right: 162 },
|
|
23
23
|
fit: { max: 132, min: 54, lines: 4 },
|
|
24
24
|
badgeHeight: 108,
|
|
25
25
|
scale: {
|
|
@@ -110,7 +110,7 @@ export const placements = {
|
|
|
110
110
|
label: '9:16 Instagram and Facebook Stories',
|
|
111
111
|
platform: 'story',
|
|
112
112
|
default: false,
|
|
113
|
-
safe: { top:
|
|
113
|
+
safe: { top: 290, bottom: 350, right: 170 },
|
|
114
114
|
fit: { max: 132, min: 54, lines: 4 },
|
|
115
115
|
badgeHeight: 108,
|
|
116
116
|
scale: {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"platform": "tiktok",
|
|
7
7
|
"default": true,
|
|
8
8
|
"safe": {
|
|
9
|
-
"top":
|
|
9
|
+
"top": 290,
|
|
10
10
|
"bottom": 430,
|
|
11
|
-
"right":
|
|
11
|
+
"right": 162
|
|
12
12
|
},
|
|
13
13
|
"fit": {
|
|
14
14
|
"max": 132,
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"platform": "story",
|
|
122
122
|
"default": false,
|
|
123
123
|
"safe": {
|
|
124
|
-
"top":
|
|
124
|
+
"top": 290,
|
|
125
125
|
"bottom": 350,
|
|
126
126
|
"right": 170
|
|
127
127
|
},
|
package/dist/creative/render.js
CHANGED
|
@@ -328,21 +328,30 @@ function applyType(board, size, leading, tracking) {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/* True when nothing in the panel crosses the artboard's edges or intrudes on
|
|
331
|
-
* the placement's bottom safe zone
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
|
|
331
|
+
* the placement's bottom safe zone, and (when `clearTop`) the headline, body
|
|
332
|
+
* and CTA start below the top safe zone. The lockup is never held to the top
|
|
333
|
+
* zone (the zone is about text). These are the same tests a headless exporter
|
|
334
|
+
* would run before writing a PNG, so fitting and that safety net cannot
|
|
335
|
+
* disagree. */
|
|
336
|
+
function fits(board, clearTop) {
|
|
335
337
|
const br = board.getBoundingClientRect();
|
|
336
338
|
const safeBottom = Number(board.dataset.safeBottom) || 0;
|
|
339
|
+
const safeTop = clearTop ? Number(board.dataset.safeTop) || 0 : 0;
|
|
337
340
|
for (const n of board.querySelectorAll('.cc-headline, .cc-body, .cc-cta, .cc-lockup')) {
|
|
338
341
|
const r = n.getBoundingClientRect();
|
|
339
342
|
if (r.top < br.top - 1 || r.right > br.right + 1) return false;
|
|
343
|
+
if (safeTop && !n.classList.contains('cc-lockup') && r.top < br.top + safeTop - 1) return false;
|
|
340
344
|
if (r.bottom > br.bottom - safeBottom + 1) return false;
|
|
341
345
|
}
|
|
342
346
|
return true;
|
|
343
347
|
}
|
|
344
348
|
|
|
345
349
|
/* Steps the headline down from the placement's max until the board fits.
|
|
350
|
+
* Prefers the largest size that fits AND clears the top safe zone; when no
|
|
351
|
+
* size does (a top-anchored layout, where shrinking never moves the start),
|
|
352
|
+
* falls back to the largest size that merely fits, exactly as before the top
|
|
353
|
+
* zone existed. One algorithm for every caller (frame, sheet, saved render),
|
|
354
|
+
* so what is checked is what is shown and shipped.
|
|
346
355
|
* Must run AFTER the board is in the document (a detached element measures
|
|
347
356
|
* zero) and AFTER document.fonts.ready (or it measures the fallback face).
|
|
348
357
|
* Steps rather than binary-searches because `text-wrap: balance` makes height
|
|
@@ -352,10 +361,13 @@ export function fitBoard(board, placements) {
|
|
|
352
361
|
if (board.dataset.autofit !== 'true') return;
|
|
353
362
|
const { max, min, lines } = placements[board.dataset.ratio].fit;
|
|
354
363
|
const headline = board.querySelector('.cc-headline');
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
364
|
+
const hasTopZone = (Number(board.dataset.safeTop) || 0) > 0;
|
|
365
|
+
for (const clearTop of hasTopZone ? [true, false] : [false]) {
|
|
366
|
+
for (let size = max; size >= min; size -= 2) {
|
|
367
|
+
applyType(board, size);
|
|
368
|
+
const used = Math.round(headline.getBoundingClientRect().height / (size * leadingFor(size)));
|
|
369
|
+
if (used <= lines && fits(board, clearTop)) return size;
|
|
370
|
+
}
|
|
359
371
|
}
|
|
360
372
|
applyType(board, min);
|
|
361
373
|
return min;
|