// The two legal documents, each one printed sheet.//// On paper (redesign phase 26, inventory §8): ONE cream sheet that grows with// the document — the title and every section heading in the serif, the "Last// updated" stamp typed in pencil under the title, a pencil rule, and the words// typewriter. Nothing else: a legal page earns nothing from decoration, and// every element that is not the words is one more thing between a reader and// what they agreed to. **No state, no loading path, no error path** — both// routes carry a permanent `READ_LESS` line saying they read nothing, so there// is nothing that can fail.//// The title is on the SHEET, not in the bar: `PaperScreen` is given none, so// the page never draws "Privacy" over "Privacy" (`ScreenTitleGuardTests`).//// Both are reached from the Settings sheet's About rows (phase 16), which is// the in-app caller the documents lacked since the sign-in footer went.importSwiftUIpublicstructLegalDocument: View {privatelet title: String/// The "Last updated" line — a legal page that hides its date is hiding/// edits.privatelet updated: Stringprivatelet intro: Stringprivatelet sections: [LegalSection]privatelet identifier: String @Environment(\.theme) privatevar themepublicinit( title: String, updated: String, intro: String, sections: [LegalSection], identifier: String ) {self.title = titleself.updated = updatedself.intro = introself.sections = sectionsself.identifier = identifier }publicvar body: someView {PaperScreen {Paper(dye: .cream, edge: .cut, seed: identifier, tilt: false, inset: 24) { VStack(alignment: .leading, spacing: 0) {Text(title) .paperTitle(LegalSheetMetrics.titleSize) .accessibilityAddTraits(.isHeader)Text(updated) .paperMeta(13) .padding(.top, 6)PencilRule(seed: "\(identifier)-rule", theme: theme) .stroke(theme.print(.pencil), lineWidth: 1) .frame(height: 3) .padding(.top, 16)Text(intro) .paperBody(LegalSheetMetrics.bodySize) .lineSpacing(LegalSheetMetrics.lineSpacing) .fixedSize(horizontal: false, vertical: true) .padding(.top, 18)ForEach(sections) { section in VStack(alignment: .leading, spacing: 0) {Text(section.heading) .paperTitle(LegalSheetMetrics.headingSize) .accessibilityAddTraits(.isHeader)ForEach(Array(section.body.enumerated()), id: \.offset) { _, paragraph inText(paragraph) .paperBody(LegalSheetMetrics.bodySize) .lineSpacing(LegalSheetMetrics.lineSpacing) .fixedSize(horizontal: false, vertical: true) .padding(.top, 10) } } .frame(maxWidth: .infinity, alignment: .leading) .padding(.top, LegalSheetMetrics.sectionGap) } } .frame(maxWidth: .infinity, alignment: .leading) } .padding(.bottom, 24) } .accessibilityIdentifier(identifier) }}/// The printed sheet's type sizes, in one place so the two documents cannot/// drift apart.enumLegalSheetMetrics {staticlet titleSize: CGFloat = 30staticlet headingSize: CGFloat = 20staticlet bodySize: CGFloat = 15staticlet lineSpacing: CGFloat = 4staticlet sectionGap: CGFloat = 26}/// `/legal/privacy`.publicstructPrivacyScreen: View {publicinit() {}publicvar body: someView {LegalDocument( title: CottonStrings.privacyTitle, updated: CottonStrings.legalUpdated, intro: CottonStrings.privacyIntro, sections: CottonStrings.privacySections, identifier: "legal-privacy" ) }}/// `/legal/terms`, exactly as `PrivacyScreen` is.////// Short on purpose: a personal notebook shared with a handful of people does/// not need a contract nobody reads, and padding one out with boilerplate the/// app cannot honour would be the dishonest option.publicstructTermsScreen: View {publicinit() {}publicvar body: someView {LegalDocument( title: CottonStrings.termsTitle, updated: CottonStrings.legalUpdated, intro: CottonStrings.termsIntro, sections: CottonStrings.termsSections, identifier: "legal-terms" ) }}