// The PLAIN face (`CardKind::Plain`, package 467cdb694): any record whose// table has no face of its own yet, so no record opens the old page — the// settings tables, a business's cards (Nancy's menu, chefs, orders and// customers), and a card of a kind this build has no face for yet (an album,// a face to confirm), its other places each under their slot's label.//// THE FRONT. The picture mounted at the top when it is handed one, its// title (wrapped to three lines before it is set smaller, and only then cut),// the line under it, the start of the body, and the core's `facts` — each// said under its column's label, two to a row when every one is short. A card// with little on it stands a little above the middle rather than at the top// of an empty sheet.//// THE PAGES. What the front has no room for is turned to, never clipped: the// whole body when the front cut it, the columns its card turns to// (`card.pages`, CottonUI's `DeckCardFill`) each under its label and cut to the room as a// note's (`FacePages`), and the facts the front could not hold. A tap turns// to the next page, a swipe either way, and past either end moves card// (`deckPassOn`), as the dish's do. A card with nothing long is one page,// with no dots.//// THE LOOK. Every face and colour is the worn theme's (`\.theme`): on paper// the typewriter in its ribbon, the title struck twice; in a business's look// its title face in its heading colour over its reading face in its body// colour (`FlavourLook` — Nancy's dark green on cream, Sharmila's teal in// Montserrat). Every word is the core's (`DeckCard`); the face only sets it.importCottonPaperimportCottonValuesimportSwiftUIpublicenumPlainFaceKnobs {publicstaticlet inset = EdgeInsets(top: 24, leading: 24, bottom: 18, trailing: 22)publicstaticlet titleSize: CGFloat = 24/// The smallest a long title is set before it is cut, of its size.publicstaticlet titleLeast: CGFloat = 0.72publicstaticlet titleLines = 3/// The struck title's second strike, of its size.publicstaticlet strike: CGFloat = 0.025publicstaticlet subtitleSize: CGFloat = 15publicstaticlet subtitleLines = 2publicstaticlet subtitleGap: CGFloat = 6publicstaticlet bodySize: CGFloat = 14publicstaticlet bodyGap: CGFloat = 10/// The picture's share of the room and the body's lines the front keeps/// before the facts take its room, most first: the one that leaves the/// fewest pages is drawn.publicstaticlet pictureTries: [(share: CGFloat, bodyLeast: Int)] = [(0.36, 3), (0.3, 3), (0.3, 2), (0.26, 2)]publicstaticlet bareTries: [(share: CGFloat, bodyLeast: Int)] = [(0, 3), (0, 2)]/// The most of the room a picture grows to into room the front leaves.publicstaticlet pictureMost: CGFloat = 0.5publicstaticlet leading: CGFloat = 2publicstaticlet pictureGap: CGFloat = 14publicstaticlet labelSize: CGFloat = 11publicstaticlet labelGap: CGFloat = 3publicstaticlet valueSize: CGFloat = 15/// The most lines a fact's words take; one that needs more is cut.publicstaticlet valueLines = 8publicstaticlet factGap: CGFloat = 10publicstaticlet columnGap: CGFloat = 16/// Above and below the hairline over the facts.publicstaticlet rulePad: CGFloat = 12publicstaticlet rule: CGFloat = 1/// What the plan keeps spare, for a line the screen wraps differently.publicstaticlet slack: CGFloat = 6/// A card whose front fills less than this share of the room stands/// higher, its spare room this share above it.publicstaticlet liftUnder: CGFloat = 0.5publicstaticlet liftShare: CGFloat = 0.38publicstaticlet pageSize: CGFloat = 14publicstaticlet pageGap: CGFloat = 10publicstaticlet dot: CGFloat = 5publicstaticlet dotGap: CGFloat = 6publicstaticlet dotsPad: CGFloat = 8/// A page not shown, its dot.publicstaticlet dotFaint = 0.4/// How far a swipe travels before it turns a page.publicstaticlet turn: CGFloat = 40publicstaticlet swipe: CGFloat = 16publicstaticlet turnTime = 0.18/// The places a card of another kind may fill, said as facts here in/// this order, each under its slot's label (`FactLabel`).publicstaticlet otherPlaces = ["date", "span", "place", "count", "state", "amount", "period", "source", "length", "group"]}/// The faces a plain card is set in, off the worn theme: on paper the/// typewriter throughout, the title struck twice; in any other family its/// title face over its reading face, its labels in its detail face.publicstructPlainType: Equatable {publicvar heading: ThemeFacepublicvar reading: ThemeFacepublicvar label: ThemeFacepublicvar struck: Boolpublicinit(_ theme: Theme) { struck = theme.family == .paper reading = theme.type.body heading = struck ? theme.type.body : theme.type.title label = struck ? theme.type.body : theme.type.meta }}/// A page past the front.publicenumPlainPage: Equatable {/// Long words under their label (none for the body's own).case words(label: String?, text: String)/// The facts the front had no room for, in their rows.case facts([[PlainFact]])}/// How a plain card fits its room: what the front holds, set how, and the/// pages after it. Measured as CoreText sets the words (`FaceMeasure`), so a/// render draws it in one pass.publicstructPlainPlan: Equatable {publicvar picture: CGFloat = 0publicvar titleSize = PlainFaceKnobs.titleSizepublicvar titleLines = 0/// The title as the front sets it: its lines joined with "\n", each/// broken only between words (`InkFit.wholeLines`).publicvar titleWords: String?publicvar subtitleLines = 0publicvar bodyLines = 0/// The facts the front holds, from the first.publicvar shown = 0/// The front's facts in their rows (`FactsMeasure.rows`).publicvar rows: [[PlainFact]] = []/// The room above a front with little on it.publicvar lift: CGFloat = 0publicvar pages: [PlainPage] = []typealias K = PlainFaceKnobspublicstaticfunc make( title: String?, subtitle: String?, body: String?, picture: Bool, facts: [PlainFact], columns: [CardPage], room: CGSize, type: PlainType ) -> PlainPlan {func best(_ room: CGSize) -> PlainPlan {let plans = (picture ? K.pictureTries : K.bareTries).map { tried in front(title: title, subtitle: subtitle, body: body, picture: picture ? tried.share : 0, bodyLeast: tried.bodyLeast, facts: facts, columns: columns, room: room, type: type) }// The one with fewest pages, then the most facts on its front,// then the biggest picture.return plans.enumerated().min { a, b in (a.element.pages.count, -a.element.shown, a.offset) < (b.element.pages.count, -b.element.shown, b.offset) }?.element ?? plans[0] }let plan = best(room)guard !plan.pages.isEmpty else { return plan }// The dots take their line under every page.var less = room less.height -= K.dotsPad + K.dotreturn best(less) }/// The front with the picture at `picture`'s share of the room (none/// for none) and the body keeping `bodyLeast` lines.privatestaticfunc front( title: String?, subtitle: String?, body: String?, picture: CGFloat, bodyLeast: Int, facts: [PlainFact], columns: [CardPage], room: CGSize, type: PlainType ) -> PlainPlan {var plan = PlainPlan()let width = room.widthvar used: CGFloat = 0if picture > 0 { plan.picture = (room.height * picture).rounded() used += plan.picture + K.pictureGap }var titleCut = falseiflet title {// Wrapped before it is set smaller, set smaller before it is cut,// and never broken inside a word: a part longer than the line (a// file's name) sets the title smaller still until it stands whole.func wrap(_ size: CGFloat) -> [String]? {InkFit.wholeLines(title, face: type.heading, size: size, width: width - (type.struck ? size * K.strike : 0)) }var size = K.titleSizevar lines = wrap(size)while (lines?.count ?? .max) > K.titleLines, size - 1 >= K.titleSize * K.titleLeast { size -= 1 lines = wrap(size) }while lines == nil, size - 1 >= 1 { size -= 1 lines = wrap(size) }let laid = lines ?? [title] plan.titleSize = size plan.titleLines = min(laid.count, K.titleLines) plan.titleWords = laid.joined(separator: "\n") titleCut = laid.count > K.titleLines used += CGFloat(plan.titleLines) * FaceMeasure.lineHeight(type.heading, size) }iflet subtitle { plan.subtitleLines = min(FaceMeasure.lines(subtitle, type.reading, K.subtitleSize, width: width), K.subtitleLines) used += K.subtitleGap + CGFloat(plan.subtitleLines) * FaceMeasure.lineHeight(type.reading, K.subtitleSize) }let need = body.map { FaceMeasure.lines($0, type.reading, K.bodySize, width: width) } ?? 0let line = FaceMeasure.lineHeight(type.reading, K.bodySize)func bodyHeight(_ lines: Int) -> CGFloat { lines == 0 ? 0 : CGFloat(lines) * line + CGFloat(lines - 1) * K.leading }func bodyFits(_ room: CGFloat) -> Int { max(0, Int(((room + K.leading) / (line + K.leading)).rounded(.down))) }var left = room.height - used - K.slack - (need > 0 ? K.bodyGap : 0)let measure = FactsMeasure(facts: facts, width: width, type: type, ruled: true)if need == 0 { plan.shown = measure.fitting(left) } elseif bodyFits(left - measure.height(facts.count)) >= min(need, bodyLeast) {// The facts all stand, the body takes what is left. plan.bodyLines = min(need, bodyFits(left - measure.height(facts.count))) plan.shown = facts.count } else {// The body keeps its first lines, the facts what fits under them,// and the body any whole lines spare after. plan.bodyLines = min(need, bodyLeast, bodyFits(left)) plan.shown = measure.fitting(left - bodyHeight(plan.bodyLines))let spare = left - bodyHeight(plan.bodyLines) - measure.height(plan.shown) plan.bodyLines = min(need, plan.bodyLines + Int((spare / (line + K.leading)).rounded(.down))) } left -= bodyHeight(plan.bodyLines) + measure.height(plan.shown) plan.rows = Array(measure.rows.prefix(measure.rowsHolding(plan.shown)))// The pages: the whole title where the front cut it, the whole body// where it cut that, the card's long columns, then the facts the// front could not hold.if titleCut, let title { plan.pages.append(.words(label: nil, text: title)) }let cut = plan.bodyLines < needlet said = body?.trimmingCharacters(in: .whitespacesAndNewlines)if cut, let body, !columns.contains(where: { $0.text == said }) { plan.pages.append(.words(label: nil, text: body)) }for column in columns where cut || column.text != said { plan.pages.append(.words(label: column.label, text: column.text)) }var rest = Array(facts.dropFirst(plan.shown))while !rest.isEmpty {let page = FactsMeasure(facts: rest, width: width, type: type, ruled: false)// At least a row a page, however tall.let rows = Array(page.rows.prefix(max(1, page.rowsFitting(room.height)))) plan.pages.append(.facts(rows)) rest.removeFirst(rows.joined().count) }// A picture takes the room the front leaves spare, up to its most.if picture > 0 { plan.picture += max(0, min(left, room.height * K.pictureMost - plan.picture)).rounded(.down) }// Little on one page stands a little above the middle.if plan.pages.isEmpty, picture == 0, left > room.height * (1 - K.liftUnder) { plan.lift = (left * K.liftShare).rounded() }return plan }}/// A run of facts in rows, as `PlainFacts` sets them, and the height they/// take: two side by side where both say one line of half the room, else/// one to a row in up to `valueLines` lines.publicstructFactsMeasure {publiclet rows: [[PlainFact]]let width: CGFloatlet type: PlainType/// Under the hairline, as on the front.let ruled: Booltypealias K = PlainFaceKnobspublicinit(facts: [PlainFact], width: CGFloat, type: PlainType, ruled: Bool) {self.width = widthself.type = typeself.ruled = ruledlet half = (width - K.columnGap) / 2func short(_ fact: PlainFact) -> Bool { FaceMeasure.lines(fact.said, type.reading, K.valueSize, width: half) <= 1 }var rows: [[PlainFact]] = []var index = 0while index < facts.count {if index + 1 < facts.count, short(facts[index]), short(facts[index + 1]) { rows.append([facts[index], facts[index + 1]]) index += 2 } else { rows.append([facts[index]]) index += 1 } }self.rows = rows }privatefunc height(of row: [PlainFact]) -> CGFloat {let label = row.contains { $0.label != nil } ? FaceMeasure.lineHeight(type.label, K.labelSize) + K.labelGap : 0let value = FaceMeasure.lineHeight(type.reading, K.valueSize)guard row.count == 1, let fact = row.first else { return label + value }let lines = min(K.valueLines, max(1, FaceMeasure.lines(fact.said, type.reading, K.valueSize, width: width)))return label + CGFloat(lines) * value }/// The height the first `count` rows take; none for none.publicfunc height(rows count: Int) -> CGFloat {guard count > 0else { return0 }let shown = rows.prefix(count)let rule = ruled ? K.rulePad * 2 + K.rule : 0return rule + shown.map(height(of:)).reduce(0, +) + CGFloat(shown.count - 1) * K.factGap }/// The height the rows holding the first `count` facts take.publicfunc height(_ count: Int) -> CGFloat { height(rows: rowsHolding(count)) }/// The rows, from the first, that fit `room`.publicfunc rowsFitting(_ room: CGFloat) -> Int {var count = 0while count < rows.count, height(rows: count + 1) <= room { count += 1 }return count }/// The facts in the rows, from the first, that fit `room`.publicfunc fitting(_ room: CGFloat) -> Int { rows.prefix(rowsFitting(room)).joined().count }/// The rows the first `count` facts stand in.publicfunc rowsHolding(_ count: Int) -> Int {var facts = 0var held = 0while held < rows.count, facts < count { facts += rows[held].count held += 1 }return held }}publicstructPlainFace: View {let card: DeckCard/// The picture mounted at the top, if any: the card's (`photo`).var picture: AnyView?/// The columns the card turns to (`card.pages`), each under its label.var pages: [CardPage] = [] @State privatevar page: Int @Environment(\.theme) privatevar theme @Environment(\.deckPassOn) privatevar passOnpublicinit(card: DeckCard, picture: AnyView? = nil, pages: [CardPage] = [], page: Int = 0) {self.card = cardself.picture = pictureself.pages = pages _page = State(initialValue: page) }/// Each fact as the core said it: its label, then its words; a place of/// another kind that says what a fact already said is left out.publicvar facts: [PlainFact] {let given: [PlainFact] = card.entries("facts").compactMap { entry inguardlet said = entry["said"]?.text, !said.isEmpty else { returnnil }returnPlainFact(label: entry["label"]?.text, said: said) }let others: [PlainFact] = PlainFaceKnobs.otherPlaces.compactMap { slot inguardlet said = card.text(slot), !given.contains(where: { $0.said == said }) else { returnnil }returnPlainFact(label: card.label(slot), said: said) }return given + others }publicvar body: someView {GeometryReader { sheet inlet inset = PlainFaceKnobs.insetlet room = CGSize( width: max(0, sheet.size.width - inset.leading - inset.trailing), height: max(0, sheet.size.height - inset.top - inset.bottom))let type = PlainType(theme)let plan = PlainPlan.make( title: card.text("title"), subtitle: card.text("subtitle"), body: card.text("body"), picture: picture != nil, facts: facts, columns: pages, room: room, type: type)AnyView(sheetView(plan, type: type)) .padding(inset) .frame(width: sheet.size.width, height: sheet.size.height, alignment: .topLeading) .clipped() }// A plain card is printed on the stock the plain face declares; a// card of a kind this build has no face for, on its pace band's paper. .onCardPaper((card.face == DefinitionCardKind.plain.rawValue ? PlainFaceCatalogue.stock : .pace).laid(card.pace)) }privatefunc sheetView(_ plan: PlainPlan, type: PlainType) -> someView {let count = 1 + plan.pages.countlet shown = min(page, count - 1)return VStack(alignment: .leading, spacing: 0) {Group {if shown == 0 {AnyView(PlainFront(card: card, picture: picture, facts: facts, plan: plan, type: type)) } else {AnyView(turned(plan.pages[shown - 1], at: shown, count: count, type: type)) } } .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)if count > 1 { PlainDots(count: count, shown: shown) } } .contentShape(Rectangle())// A tap turns to the next page, the last back to the first; a swipe// turns either way, and past either end moves card. .gesture(count > 1 ? TapGesture().onEnded { page = (shown + 1) % count } : nil) .facePages(count > 1 ? turning(from: shown, count: count) : nil, at: "\(shown)/\(count)") { forward inlet next = shown + (forward ? 1 : -1)if (0..<count).contains(next) { page = next } else { passOn?(forward) } } .animation(.easeOut(duration: PlainFaceKnobs.turnTime), value: page) } @ViewBuilderprivatefunc turned(_ turned: PlainPage, at shown: Int, count: Int, type: PlainType) -> someView {switch turned {case .words(let label, let text): VStack(alignment: .leading, spacing: PlainFaceKnobs.pageGap) {iflet label { PlainLabel(words: label, type: type) }// The words cut to the room as a note's; past their last page// the card turns on, past their first back.PlainPagesText(text: text, type: type) .environment(\.deckPassOn, { forward inlet next = shown + (forward ? 1 : -1)if (0..<count).contains(next) { page = next } else { passOn?(forward) } }) } .accessibilityIdentifier("face-page-\(shown)")case .facts(let rows):PlainFacts(rows: rows, type: type) .accessibilityIdentifier("face-page-\(shown)") } }privatefunc turning(from shown: Int, count: Int) -> someGesture {DragGesture(minimumDistance: PlainFaceKnobs.swipe) .onEnded { end inlet dx = end.translation.widthguard abs(dx) > PlainFaceKnobs.turn, abs(dx) > abs(end.translation.height) else { return }let next = shown + (dx < 0 ? 1 : -1)if (0..<count).contains(next) { page = next } else { passOn?(dx < 0) } } }}/// The front: the picture, the title, the line under it, the body's start/// and the facts it has room for, as the plan fits them.privatestructPlainFront: View {let card: DeckCardlet picture: AnyView?let facts: [PlainFact]let plan: PlainPlanlet type: PlainTypetypealias K = PlainFaceKnobsvar body: someView { VStack(alignment: .leading, spacing: 0) {iflet picture, plan.picture > 0 {MountedPrint(photo: picture) .frame(height: plan.picture) .padding(.bottom, K.pictureGap) .facePart(.picture) }iflet title = plan.titleWords ?? card.text("title"), plan.titleLines > 0 {PlainTitle(words: title, size: plan.titleSize, lines: plan.titleLines, type: type) .accessibilityIdentifier("deck-title") .facePart(.title) }iflet subtitle = card.text("subtitle"), plan.subtitleLines > 0 {Text(subtitle) .font(type.reading.font(K.subtitleSize)) .lineLimit(plan.subtitleLines) .plainInk(.label) .padding(.top, K.subtitleGap) .facePart(.subtitle) }iflet body = card.text("body"), plan.bodyLines > 0 {Text(body) .font(type.reading.font(K.bodySize)) .lineSpacing(K.leading) .lineLimit(plan.bodyLines) .plainInk(.reading) .padding(.top, K.bodyGap) }if plan.shown > 0 {FaceHairline().padding(.top, K.rulePad)PlainFacts(rows: plan.rows, type: type) .padding(.top, K.rulePad) .accessibilityIdentifier("deck-facts") } } .padding(.top, plan.lift) }}/// The title: on paper typed heavy, struck twice; in a business's look its/// title face in its heading colour.privatestructPlainTitle: View {let words: Stringlet size: CGFloatlet lines: Intlet type: PlainTypevar body: someView {if type.struck {HeavyType(words: words, size: size) .lineLimit(lines) } else {Text(words) .font(type.heading.font(size)) .lineLimit(lines) .plainInk(.heading) .fixedSize(horizontal: false, vertical: true) .accessibilityAddTraits(.isHeader) } }}/// The facts in their rows, each said under its label: two side by side/// on one line each, or one in up to `valueLines` lines.privatestructPlainFacts: View {let rows: [[PlainFact]]let type: PlainTypetypealias K = PlainFaceKnobsvar body: someView { VStack(alignment: .leading, spacing: K.factGap) {ForEach(Array(rows.enumerated()), id: \.offset) { _, row in HStack(alignment: .top, spacing: K.columnGap) {ForEach(Array(row.enumerated()), id: \.offset) { _, fact inPlainFactView(fact: fact, lines: row.count > 1 ? 1 : K.valueLines, type: type) } } } } }}privatestructPlainFactView: View {let fact: PlainFactlet lines: Intlet type: PlainTypevar body: someView { VStack(alignment: .leading, spacing: PlainFaceKnobs.labelGap) {iflet label = fact.label { PlainLabel(words: label, type: type) }Text(fact.said) .font(type.reading.font(PlainFaceKnobs.valueSize)) .lineLimit(lines) .plainInk(.reading) } .frame(maxWidth: .infinity, alignment: .leading) .accessibilityElement(children: .combine) }}/// A fact's or a page's small label.privatestructPlainLabel: View {let words: Stringlet type: PlainTypevar body: someView {Text(words) .font(type.label.font(PlainFaceKnobs.labelSize)) .lineLimit(1) .plainInk(.label) }}/// A page's long words cut to the room, in the reading face and colour.privatestructPlainPagesText: View {let text: Stringlet type: PlainType @Environment(\.theme) privatevar themevar body: someView {FacePages( text: text, size: PlainFaceKnobs.pageSize, face: type.reading, colour: type.struck ? nil : theme.text(.body)) }}/// A dot a page, the shown one inked.privatestructPlainDots: View {let count: Intlet shown: Intvar body: someView { HStack(spacing: PlainFaceKnobs.dotGap) {Spacer(minLength: 0)ForEach(0..<count, id: \.self) { index inCircle() .frame(width: PlainFaceKnobs.dot, height: PlainFaceKnobs.dot) .faceInk(index == shown ? .ink : .pencil) .opacity(index == shown ? 1 : PlainFaceKnobs.dotFaint) }Spacer(minLength: 0) } .padding(.top, PlainFaceKnobs.dotsPad) .accessibilityHidden(true) }}/// What a plain card's words are: its title, its body, its labels.enumPlainInk {case heading, reading, label}/// A plain card's words in the worn theme's inks: on paper the ribbon and/// its pencil, in a business's look its heading, body and detail colours.privatestructPlainInkModifier: ViewModifier {let ink: PlainInk @Environment(\.theme) privatevar themefunc body(content: Content) -> someView {if theme.family == .paper { content.faceInk(ink == .label ? .pencil : .ink) } else { content .foregroundStyle(ink == .heading ? theme.print(.ink) : theme.text(ink == .label ? .secondary : .body)) .blendMode(theme.printBlend) } }}extensionView {fileprivatefunc plainInk(_ ink: PlainInk) -> someView { modifier(PlainInkModifier(ink: ink)) }}/// The plain face, by the kind's name, and the cards it is reviewed in: a/// setting, a device, a kitchen's chef, customer, order and place, a card of/// a kind with no face yet, with the pages it turns to (`shapes` holds the/// ones a reviewer turns to). A dish is drawn on its plate (`DishFace`).publicenumPlainFaceCatalogue {publicstaticlet stock: FaceStock = .framedpublicstaticlet ground: FaceGround = .paperpublicstaticlet face = Face(id: "plain", specimens: shapes.map { Specimen($0.name, $0.card, picture: $0.picture) }) { card, picture, _ inif card.isDish {DishFace(card: card, picture: picture, pages: card.pages, rating: card.stars, mark: DishKindMark.ink(card.stored["subtitle"])) } else {PlainFace(card: card, picture: picture.map { AnyView($0) }, pages: card.pages) } }/// A fact as the core says it, under its column's label.publicstaticfunc fact(_ label: String, _ said: String) -> RecordValue { .object(["label": .text(label), "said": .text(said)]) }publicstaticlet setting = DeckCard(face: .plain, fields: ["title": .text("Week starts on"), "subtitle": .text("Monday")])publicstaticlet longTitle = DeckCard(face: .plain, fields: ["title": .text("An invented reminder whose title runs on for far longer than any card was ever meant to hold in one go"),"subtitle": .text("Invented setting"), ])publicstaticlet machine = DeckCard(face: .plain, fields: ["title": .text("Invented studio Mac"),"subtitle": .text("Serving · answered a minute ago"),"facts": .list([ fact("Kind", "Mac"), fact("Platform", "macOS"), fact("Build", "2026.10.23 (431)"), fact("System", "macOS 26.1"), fact("Chip", "Apple M4 Pro"), fact("Memory", "48 GB"), fact("Disk", "1 TB"), fact("Last seen", "2 minutes ago"), ]), ])publicstaticlet chefBio = """ Invented chef grew up cooking over a wood fire in an invented hill village, where smoked pork, \ fermented bamboo shoot and axone were the week's rhythm. She learned from her grandmother, who \ measured nothing and tasted everything, and from an aunt who ran a roadside kitchen for truckers \ on the invented highway. She came to the city to study and stayed to cook: first for friends on \ Sundays, then for a dozen neighbours, now for anyone who orders a day ahead. Her dal is mild, her \ chutneys are not, and every dish is cooked the morning it leaves. """publicstaticlet chef = DeckCard(face: .plain, fields: ["photo": .text("portrait"),"title": .text("Invented Chef Example"),"subtitle": .text("Invented Hill Village"),"body": .text(chefBio),"date": .text("12 years ago"),"facts": .list([fact("Rating", "4.8"), fact("Reviews", "23"), fact("Cooking since", "Mar 2014")]), ])publicstaticlet chefPages = [CardPage(label: "Bio", text: chefBio)]publicstaticlet customer = DeckCard(face: .plain, fields: ["title": .text("Invented Customer"),"subtitle": .text("+91 98000 00000"),"body": .text("Flat 4B, Invented Apartments, 12th Cross, Invented Layout, Bengaluru 560000"),"amount": .text("\u{20B9}1,200"),"facts": .list([ fact("Orders", "14"), fact("Billed", "\u{20B9}4,850"), fact("Paid", "\u{20B9}3,650"), fact("Owed", "\u{20B9}1,200"), fact("Last order", "Tue 20 Oct"), ]), ])publicstaticlet order = DeckCard(face: .plain, fields: ["title": .text("Invented Customer \u{00B7} Thu 22 Oct"),"subtitle": .text("Lunch \u{00B7} 2"),"body": .text("Leave it with the guard at the gate"),"amount": .text("\u{20B9}360"),"date": .text("Thu 22 Oct"),"facts": .list([fact("Total", "\u{20B9}360"), fact("Plates", "2"), fact("For", "Thu 22 Oct")]), ])publicstaticlet place = DeckCard(face: .plain, fields: ["photo": .text("verandah"),"title": .text("Invented Kitchen"),"subtitle": .text("14 Invented Road, Invented Town"),"body": .text("A home kitchen cooking the food of the invented hills, one menu a day."),"facts": .list([ fact("Delivers to", "Invented Layout, Invented Nagar, the old airport road as far as the invented lake, and anywhere within five kilometres"), fact("Address", "14 Invented Road, Invented Town"), fact("Directions", "Past the invented temple, second left, the blue gate opposite the bakery"), ]), ])/// A kind this build has no face for yet: its other places as facts.publicstaticlet unknownKind = DeckCard(face: "sighting", corner: nil, pressing: false, pace: nil, plate: nil, fields: ["title": .text("A face to confirm"),"date": .text("Sat 17 Oct"),"place": .text("Invented Hill Station"),"count": .text("3 photos"),"state": .text("Not confirmed"), ])/// One shape: its card, its picture's fixture and the pages it turns to.publicstructShape: Sendable {publiclet name: Stringpubliclet card: DeckCardpublicvar picture: String?publicvar pages: [CardPage] = [] }/// Every shape, with the pages each turns to.publicstaticlet shapes: [Shape] = [Shape(name: "setting", card: setting),Shape(name: "long-title", card: longTitle),Shape(name: "machine", card: machine),Shape(name: "chef", card: chef, picture: "portrait", pages: chefPages),Shape(name: "customer", card: customer),Shape(name: "order", card: order),Shape(name: "place", card: place, picture: "verandah"),Shape(name: "unknown-kind", card: unknownKind), ]}