(ir: SemanticIR, presentation: ResolvedPresentation)
| 912 | } |
| 913 | |
| 914 | function junior(ir: SemanticIR, presentation: ResolvedPresentation): TwinViewModel { |
| 915 | const facets = presentation.facets; |
| 916 | const sections = visibleSections(ir, presentation); |
| 917 | const showSteps = facets.has(Facet.Logic) || facets.has(Facet.Calls); |
| 918 | const steps = showSteps ? juniorSteps(ir) : []; |
| 919 | const paragraphs = [overviewClauses(ir, facets).join(' ')]; |
| 920 | if (showSteps) { |
| 921 | // The lead is only honest when there is an order to lead into, and the |
| 922 | // sentence about there being none is honest only when the reader asked |
| 923 | // for the lens that would have shown one. |
| 924 | paragraphs.push(steps.length > 0 ? JUNIOR_ORDER_LEAD : JUNIOR_NO_STEPS); |
| 925 | } |
| 926 | const notes = emptyNotes(sections); |
| 927 | return { |
| 928 | ...emptyModel(ir, presentation, 'guided'), |
| 929 | paragraphs, |
| 930 | notes, |
| 931 | steps, |
| 932 | terms: juniorTerms(ir, facets), |
| 933 | rewritable: readerLines([ |
| 934 | ...paragraphs.map((text, index) => ({ id: `p${index}`, text })), |
| 935 | ...steps.map((step) => ({ id: step.id, text: step.text })), |
| 936 | ...notes.map((text, index) => ({ id: `n${index}`, text })) |
| 937 | ]) |
| 938 | }; |
| 939 | } |
| 940 | |
| 941 | // --------------------------------------------------------------------------- |
| 942 | // level 3, senior: what it costs |
no test coverage detected