// Cotton Story's SCENE CARD (`scene.card`, contract 17 Nov 2026): the scene's// number and heading, then its summary if it has one, else its opening lines// laid out as a screenplay, and its length at the foot; its status quietly// beside the number. Flat and typographic: a sheet, a hairline, type.//// Slots: `number` (the scene's place in the story), `title` (the heading as// written), `subtitle` (the one-line summary), `lines` (its lines as the// core read them) or `body`, `length` ("2 pages", "under a page"), `state`// (its status, said only when it is not a draft). Every word is the core's.importCottonPaperimportCottonValuesimportSwiftUIenumStorySceneCardKnobs {staticlet scriptSize: CGFloat = 13staticlet headingSize: CGFloat = 17}structStorySceneCardFace: View {let card: DeckCardinit(card: DeckCard) {self.card = card }var body: someView { VStack(alignment: .leading, spacing: StoryCardKnobs.gap) { HStack(alignment: .firstTextBaseline) {iflet number = card.text("number") {StoryQuietLine(text: number) .accessibilityIdentifier("scene-number") .facePart(.subtitle) }Spacer(minLength: 8)iflet state = card.text("state") {StoryQuietLine(text: state) .accessibilityIdentifier("scene-state") } }iflet heading = card.text("title") {Text(verbatim: heading) .font(StoryType.script(StorySceneCardKnobs.headingSize, relativeTo: .headline).bold()) .foregroundStyle(StoryMaterial.ink.colour) .fixedSize(horizontal: false, vertical: true) .accessibilityIdentifier("deck-title") .facePart(.title) }iflet summary = card.text("subtitle") {Text(verbatim: summary) .font(StoryType.sans(.body)) .foregroundStyle(StoryMaterial.ink.colour) .fixedSize(horizontal: false, vertical: true) .accessibilityIdentifier("scene-summary")Spacer(minLength: 0) } else {StoryScriptLines(lines: StoryLine.of(card), size: StorySceneCardKnobs.scriptSize) .storyFadesOut() .accessibilityIdentifier("scene-opening") .facePart(.body) }iflet length = card.text("length") {StoryQuietLine(text: length) .accessibilityIdentifier("scene-length") } } .padding(StoryCardKnobs.inset) .storySheet() .accessibilityElement(children: .contain) .accessibilityIdentifier("scene-card") }}/// The scene card, and the cards it is reviewed in.publicenumStorySceneCardFaceCatalogue {publicstaticlet stock: FaceStock = .ownpublicstaticlet ground: FaceGround = .blankpublicstaticlet face = Face(id: "scene.card", specimens: [Specimen("opening", opening), Specimen("summary", summarised), Specimen("telugu", telugu), Specimen("empty", empty), ]) { card, _, _ inStorySceneCardFace(card: card) }/// A two-hander's first lines, no summary yet.publicstaticlet opening = DeckCard(face: "scene.card", corner: nil, pressing: false, pace: nil, plate: nil, fields: ["number": .text("3"),"title": .text("INT. LIGHTHOUSE KITCHEN - NIGHT"),"lines": StoryLine.fields(StorySpecimenLinesCatalogue.twoHander),"length": .text("1 ⅜ pages"), ])/// A scene with its one-line summary, marked done.publicstaticlet summarised = DeckCard(face: "scene.card", corner: nil, pressing: false, pace: nil, plate: nil, fields: ["number": .text("12"),"title": .text("EXT. HARBOUR WALL - DAY"),"subtitle": .text("Ravi finally tells Meera the boat was never sold."),"length": .text("under a page"),"state": .text("Done"), ])/// A scene written in Telugu: the script face falls back to the/// system's Telugu beside its Latin.publicstaticlet telugu = DeckCard(face: "scene.card", corner: nil, pressing: false, pace: nil, plate: nil, fields: ["number": .text("7"),"title": .text("INT. వంటగది - రాత్రి"),"lines": StoryLine.fields(StorySpecimenLinesCatalogue.telugu),"length": .text("under a page"), ])/// A new scene: a heading and nothing else yet.publicstaticlet empty = DeckCard(face: "scene.card", corner: nil, pressing: false, pace: nil, plate: nil, fields: ["number": .text("1"),"title": .text("INT. SOMEWHERE - DAY"), ])}/// Invented scenes the Story faces are reviewed in.enumStorySpecimenLinesCatalogue {staticlet twoHander: [StoryLine] = [StoryLine(.action, "Rain on the glass. MEERA (30s) sets two cups down, too hard."),StoryLine(.blank, ""),StoryLine(.character, "MEERA"),StoryLine(.dialogue, "You said the boat was sold."),StoryLine(.blank, ""),StoryLine(.character, "RAVI"),StoryLine(.parenthetical, "(not looking up)"),StoryLine(.dialogue, "I said someone wanted it."),StoryLine(.blank, ""),StoryLine(.action, "The lamp swings once. Neither of them moves."),StoryLine(.blank, ""),StoryLine(.character, "MEERA"),StoryLine(.dialogue, "Then who has been paying for the mooring?"),StoryLine(.blank, ""),StoryLine(.character, "RAVI"),StoryLine(.dialogue, "Drink your tea."),StoryLine(.blank, ""),StoryLine(.transition, "CUT TO:"), ]staticlet telugu: [StoryLine] = [StoryLine(.action, "వర్షం. మీర కిటికీ దగ్గర నిలబడి ఉంది."),StoryLine(.blank, ""),StoryLine(.character, "మీర"),StoryLine(.dialogue, "పడవ అమ్మేశావని చెప్పావు కదా?"),StoryLine(.blank, ""),StoryLine(.character, "రవి"),StoryLine(.parenthetical, "(నెమ్మదిగా)"),StoryLine(.dialogue, "ఎవరో అడిగారని మాత్రమే చెప్పాను."), ]}