// The TOOLS deck (row B of the deck faces): the Tools card on the dial opens// a deck with one card per installed tool, never a grid or a list. Each card// is the framed cream card with the tool's own picture large at its top, its// name typed heavy, what it is for (`purpose`) typed under it, and at the// foot what its home table holds, in the core's words ("42 open · 3 due").// A tap opens the tool; a hold lifts the card with its acts. The picture is// the app's (`object`, CottonUI's `ToolObject` at the side the face gives// it).importCottonPaperimportCottonValuesimportSwiftUIenumToolFaceKnobs {staticlet inset = EdgeInsets(top: 26, leading: 26, bottom: 22, trailing: 22)staticlet pictureShare: CGFloat = 0.58staticlet nameSize: CGFloat = 30staticlet purposeSize: CGFloat = 15staticlet figureSize: CGFloat = 13}publicstructToolFace<Object: View>: View {let name: Stringlet purpose: String?/// What its home table holds, as the core said it.let figure: String?/// The tool's picture, at the side the face gives it.let object: (_ side: CGFloat) -> Objectpublicinit(name: String, purpose: String?, figure: String?, @ViewBuilder object: @escaping (_ side: CGFloat) -> Object) {self.name = nameself.purpose = purposeself.figure = figureself.object = object }publicvar body: someView {GeometryReader { sheet in VStack(alignment: .leading, spacing: 0) { object(sheet.size.width * ToolFaceKnobs.pictureShare) .frame(width: sheet.size.width * ToolFaceKnobs.pictureShare, height: sheet.size.width * ToolFaceKnobs.pictureShare) .facePart(.picture) .frame(maxWidth: .infinity) .accessibilityHidden(true)HeavyType(words: name, size: ToolFaceKnobs.nameSize) .lineLimit(1) .minimumScaleFactor(0.6) .padding(.top, 14) .accessibilityIdentifier("deck-title") .facePart(.title)iflet purpose {Text(purpose) .font(CottonFonts.type(ToolFaceKnobs.purposeSize)) .lineSpacing(3) .lineLimit(5) .faceInk(.ink) .fixedSize(horizontal: false, vertical: true) .padding(.top, 8) .facePart(.body) }Spacer(minLength: 8)iflet figure {FaceHairline()Text(figure) .font(CottonFonts.type(ToolFaceKnobs.figureSize)) .lineLimit(2) .faceInk(.pencil) .padding(.top, 8) } } .padding(ToolFaceKnobs.inset) } .onCardPaper(ToolFaceCatalogue.stock.laid(nil)) }}/// The tool face, and the cards it is reviewed in. No card kind names it: the/// Tools deck draws each installed tool with it (CottonUI's `ToolsDeck`)./// From a card, its name (`title`), what it is for (`body`) and what its/// home table holds (`count`).publicenumToolFaceCatalogue {publicstaticlet stock: FaceStock = .framedpublicstaticlet ground: FaceGround = .paperpublicstaticlet face = Face(id: "cotton.tool", specimens: [Specimen("calendar", calendar)]) { card, picture, _ inToolFace(name: card.text("title") ?? "", purpose: card.text("body"), figure: card.text("count")) { side iniflet picture { picture.frame(width: side, height: side) } } }publicstaticlet calendar = DeckCard(face: .plain, fields: ["title": .text("Calendar"), "body": .text("Events and time you have planned."), "count": .text("3 today"), ])}