{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://docs.smithable.ai/schema/smithable-content-0.1.json",
  "title": "smithable.content.yml",
  "description": "Visible text that should read differently from what the names give, and the app's language.",
  "type": "object",
  "required": [
    "smithableContent"
  ],
  "additionalProperties": false,
  "properties": {
    "smithableContent": {
      "description": "The file format version.",
      "enum": [
        0.1,
        "0.1"
      ]
    },
    "language": {
      "title": "Language",
      "enum": [
        "en",
        "sv"
      ],
      "description": "The language of everything a person reads in the app (the app's own words follow it): en, sv; en is the default."
    },
    "languages": {
      "title": "Other languages",
      "type": "array",
      "items": {
        "enum": [
          "en",
          "sv"
        ]
      },
      "uniqueItems": true,
      "description": "The other languages the app is offered in, each with its file smithable.content.<language>.yml of the same texts (docs/design/languages.md)."
    },
    "logo": {
      "title": "Logo",
      "type": "object",
      "description": "The app's mark, before its name in the menu and the landing page's header, and its tab icon: { src: images/logo.webp, alt: what it shows }.",
      "required": [
        "src",
        "alt"
      ],
      "additionalProperties": false,
      "properties": {
        "src": {
          "type": "string",
          "description": "A file under public/images/: webp, avif, jpg, png or svg."
        },
        "alt": {
          "type": "string",
          "description": "What the mark shows."
        },
        "generated": {
          "type": "boolean",
          "description": "Made by an AI (a mark is never badged)."
        }
      }
    },
    "initials": {
      "title": "Initials",
      "type": "string",
      "pattern": "^(?!.*[\\uFE0F\\u20E3])(?:[\\p{L}\\p{Nd}]\\p{M}{0,3}){1,2}$",
      "description": "The one or two letters on the app's tile, its tab icon; nothing said, the first letters of its name's first two words (smithable validate --explain says which)."
    },
    "models": {
      "title": "Kinds of record",
      "type": "object",
      "description": "Each model's texts, by the model's name.",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "description": "The singular, e.g. \"Client\"; the plural follows unless pluralLabel says otherwise."
          },
          "pluralLabel": {
            "type": "string",
            "description": "The plural, e.g. \"Clients\". In another language than English, give it."
          },
          "fields": {
            "type": "object",
            "description": "Each field's texts, by the field's name.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "label": {
                  "type": "string",
                  "description": "The field's label."
                },
                "help": {
                  "type": "string",
                  "description": "A line under the form field."
                },
                "values": {
                  "type": "object",
                  "description": "A choice field's values' texts: { smb: Small business }.",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "reserve": {
            "type": "object",
            "description": "A model with a capacity: the reservation block's words.",
            "additionalProperties": false,
            "properties": {
              "book": {
                "type": "string",
                "description": "The button to take a place."
              },
              "cancel": {
                "type": "string",
                "description": "The button to give it up."
              },
              "full": {
                "type": "string",
                "description": "When no place is left."
              },
              "booked": {
                "type": "string",
                "description": "When the viewer has a place."
              }
            }
          }
        }
      }
    },
    "pages": {
      "title": "Pages",
      "type": "object",
      "description": "Each page's texts, by the page's name: its title and subtitle, and its sections' or tiles' texts by their names.",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "The page's heading and menu entry."
          },
          "subtitle": {
            "type": "string",
            "description": "A line under the heading."
          },
          "description": {
            "type": "string",
            "description": "What search engines show under the page's name, one or two sentences; for a public page."
          },
          "reviewed": {
            "type": "object",
            "description": "A privacy page: the owner's review of its description of the app, written by reviewPrivacyPage: the facts' fingerprint and the day.",
            "additionalProperties": false,
            "properties": {
              "facts": {
                "type": "string",
                "pattern": "^[0-9a-f]{16}$",
                "description": "The fingerprint of the facts reviewed: sixteen hexadecimal digits."
              },
              "on": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "The day it was reviewed, UTC."
              }
            }
          },
          "keeps": {
            "type": "object",
            "description": "A privacy page: how long each kind of record is kept, in your words, by its name: { Booking: Two years after the class, for the bookkeeping. }.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "services": {
            "description": "A privacy page: other services you use that the app's files do not show, e.g. a mail service. Elsewhere, a section named services.",
            "oneOf": [
              {
                "type": "object"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "The service's name."
                    },
                    "for": {
                      "type": "string",
                      "description": "What it is used for."
                    },
                    "where": {
                      "type": "string",
                      "description": "Where it runs, e.g. \"in the EU\"."
                    }
                  }
                }
              }
            ]
          },
          "custom": {
            "description": "A privacy page: what your own functions (custom code and custom actions) do with people's details, in your words. Elsewhere, a section named custom.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ]
          },
          "form": {
            "type": "object",
            "description": "The form's sections' headings: { sections: { contact: { title: How to reach them } } }.",
            "additionalProperties": false,
            "properties": {
              "sections": {
                "type": "object",
                "description": "Each section's heading, by the section's name in smithable.ux.yml.",
                "additionalProperties": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "title": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "fields": {
            "type": "object",
            "description": "A calculator page's fields' labels and help.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "label": {
                  "type": "string"
                },
                "help": {
                  "type": "string"
                }
              }
            }
          },
          "results": {
            "type": "object",
            "description": "A calculator page's results heading.",
            "additionalProperties": false,
            "properties": {
              "title": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": {
          "type": "object",
          "description": "A landing page's section's texts, by the section's name in smithable.yml.",
          "additionalProperties": false,
          "properties": {
            "eyebrow": {
              "type": "string",
              "description": "A short line over the heading, e.g. what the section is."
            },
            "title": {
              "type": "string",
              "description": "The section's heading."
            },
            "subtitle": {
              "type": "string",
              "description": "A hero's line under the heading."
            },
            "caption": {
              "type": "string",
              "description": "A media/text section picture caption."
            },
            "text": {
              "type": "string",
              "description": "A paragraph under the heading."
            },
            "button": {
              "type": "string",
              "description": "The button's text."
            },
            "secondButton": {
              "type": "string",
              "description": "A hero's second button's text (secondButton in smithable.yml); the page's title when not given."
            },
            "image": {
              "type": "object",
              "description": "A section picture, including a background behind text, an invitation or features: { src: images/hero.webp, alt: what it shows }.",
              "additionalProperties": false,
              "dependencies": {
                "kept": {
                  "required": [
                    "generated"
                  ],
                  "properties": {
                    "generated": {
                      "const": true
                    }
                  }
                }
              },
              "properties": {
                "src": {
                  "type": "string"
                },
                "asset": {
                  "type": "string",
                  "pattern": "^m_[0-9a-hjkmnp-tv-z]{26}$",
                  "description": "A stored file from the hosted service's photo library, in place of src; set by setSectionPicture, never written by hand."
                },
                "alt": {
                  "type": "string"
                },
                "generated": {
                  "type": "boolean",
                  "description": "Made by an AI: the app marks it as such where it could pass for a photograph."
                },
                "kind": {
                  "enum": [
                    "ai-realistic",
                    "ai-drawn",
                    "photograph"
                  ],
                  "description": "What the picture is, as the image library said when it was placed: an AI picture that looks real, a drawn AI picture, or a photograph. The badge's default follows it."
                },
                "kept": {
                  "const": true,
                  "description": "The owner kept this picture an AI made where it presents their work: the release review does not ask again. Only beside generated: true."
                },
                "width": {
                  "type": "integer",
                  "description": "The file's own width in pixels; a stored file's largest rendition.",
                  "minimum": 100,
                  "maximum": 4000
                },
                "widths": {
                  "type": "array",
                  "description": "Its copies' widths in pixels, narrowest first, each a file beside it named by its width (images/hero-2400.webp).",
                  "items": {
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 4000
                  },
                  "minItems": 1,
                  "maxItems": 6
                },
                "film": {
                  "type": "object",
                  "description": "A hero's short silent loop over its picture (an MP4 under public/images/, 3 to 12 seconds, at most 5 MB, or a stored film); the picture shows first and for anyone who gets no film. Set it with setSectionFilm.",
                  "additionalProperties": false,
                  "dependencies": {
                    "src": {
                      "not": {
                        "anyOf": [
                          {
                            "required": [
                              "asset"
                            ]
                          },
                          {
                            "required": [
                              "heights"
                            ]
                          }
                        ]
                      }
                    },
                    "asset": [
                      "heights"
                    ],
                    "heights": [
                      "asset"
                    ]
                  },
                  "allOf": [
                    {
                      "anyOf": [
                        {
                          "required": [
                            "src"
                          ]
                        },
                        {
                          "required": [
                            "asset"
                          ]
                        }
                      ]
                    }
                  ],
                  "properties": {
                    "src": {
                      "type": "string",
                      "pattern": "^images/([\\w-][\\w.-]*/)*[\\w-][\\w.-]*\\.mp4$"
                    },
                    "asset": {
                      "type": "string",
                      "pattern": "^m_[0-9a-hjkmnp-tv-z]{26}$",
                      "description": "A stored film from the hosted service's library, in place of src; set by setSectionFilm, never written by hand."
                    },
                    "heights": {
                      "type": "array",
                      "description": "A stored film's renditions by height, lowest first; from its record.",
                      "items": {
                        "enum": [
                          720,
                          1080
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 2
                    },
                    "generated": {
                      "type": "boolean",
                      "description": "Made by an AI: its own origin, not the picture's."
                    },
                    "kind": {
                      "enum": [
                        "ai-realistic",
                        "ai-drawn",
                        "photograph"
                      ],
                      "description": "What the film is, as a picture's kind: the badge follows it while it plays."
                    }
                  }
                }
              }
            },
            "tiles": {
              "type": "object",
              "description": "A tiles hero's tiles, by the page of each of its shortcuts: { menu: { label: Our menu, image: { src, alt } } }; the label unsaid is the page's title.",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "image": {
                    "type": "object",
                    "additionalProperties": false,
                    "dependencies": {
                      "kept": {
                        "required": [
                          "generated"
                        ],
                        "properties": {
                          "generated": {
                            "const": true
                          }
                        }
                      }
                    },
                    "properties": {
                      "src": {
                        "type": "string"
                      },
                      "asset": {
                        "type": "string",
                        "pattern": "^m_[0-9a-hjkmnp-tv-z]{26}$",
                        "description": "A stored file from the hosted service's photo library, in place of src; set by setSectionPicture, never written by hand."
                      },
                      "alt": {
                        "type": "string"
                      },
                      "generated": {
                        "type": "boolean",
                        "description": "Made by an AI: the app marks it as such where it could pass for a photograph."
                      },
                      "kind": {
                        "enum": [
                          "ai-realistic",
                          "ai-drawn",
                          "photograph"
                        ],
                        "description": "What the picture is, as the image library said when it was placed: an AI picture that looks real, a drawn AI picture, or a photograph. The badge's default follows it."
                      },
                      "kept": {
                        "const": true,
                        "description": "The owner kept this picture an AI made where it presents their work: the release review does not ask again. Only beside generated: true."
                      },
                      "width": {
                        "type": "integer",
                        "description": "The file's own width in pixels; a stored file's largest rendition.",
                        "minimum": 100,
                        "maximum": 4000
                      },
                      "widths": {
                        "type": "array",
                        "description": "Its copies' widths in pixels, narrowest first, each a file beside it named by its width (images/hero-2400.webp).",
                        "items": {
                          "type": "integer",
                          "minimum": 100,
                          "maximum": 4000
                        },
                        "minItems": 1,
                        "maxItems": 6
                      }
                    }
                  }
                }
              }
            },
            "items": {
              "type": "array",
              "description": "The section's items: features, plans, testimonials, questions, pictures, footer links.",
              "items": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "price": {
                    "type": "string"
                  },
                  "period": {
                    "type": "string"
                  },
                  "features": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "A plan's features."
                  },
                  "button": {
                    "type": "string"
                  },
                  "quote": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  },
                  "question": {
                    "type": "string"
                  },
                  "answer": {
                    "type": "string"
                  },
                  "image": {
                    "type": "object",
                    "description": "A gallery, feature card or media collage picture: { src: images/…, alt: what it shows }.",
                    "additionalProperties": false,
                    "dependencies": {
                      "kept": {
                        "required": [
                          "generated"
                        ],
                        "properties": {
                          "generated": {
                            "const": true
                          }
                        }
                      }
                    },
                    "properties": {
                      "src": {
                        "type": "string"
                      },
                      "asset": {
                        "type": "string",
                        "pattern": "^m_[0-9a-hjkmnp-tv-z]{26}$",
                        "description": "A stored file from the hosted service's photo library, in place of src; set by setSectionPicture, never written by hand."
                      },
                      "alt": {
                        "type": "string"
                      },
                      "generated": {
                        "type": "boolean",
                        "description": "Made by an AI: the app marks it as such where it could pass for a photograph."
                      },
                      "kind": {
                        "enum": [
                          "ai-realistic",
                          "ai-drawn",
                          "photograph"
                        ],
                        "description": "What the picture is, as the image library said when it was placed: an AI picture that looks real, a drawn AI picture, or a photograph. The badge's default follows it."
                      },
                      "kept": {
                        "const": true,
                        "description": "The owner kept this picture an AI made where it presents their work: the release review does not ask again. Only beside generated: true."
                      },
                      "width": {
                        "type": "integer",
                        "description": "The file's own width in pixels; a stored file's largest rendition.",
                        "minimum": 100,
                        "maximum": 4000
                      },
                      "widths": {
                        "type": "array",
                        "description": "Its copies' widths in pixels, narrowest first, each a file beside it named by its width (images/hero-2400.webp).",
                        "items": {
                          "type": "integer",
                          "minimum": 100,
                          "maximum": 4000
                        },
                        "minItems": 1,
                        "maxItems": 6
                      }
                    }
                  },
                  "caption": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "link": {
                    "type": "string"
                  }
                }
              }
            },
            "address": {
              "type": "string",
              "description": "A contact section's address, one line per line."
            },
            "phone": {
              "type": "string",
              "description": "A contact section's phone number."
            },
            "email": {
              "type": "string",
              "description": "A contact section's email address."
            },
            "hours": {
              "type": "string",
              "description": "Opening hours, one per line."
            },
            "thanks": {
              "type": "string",
              "description": "What a visitor reads once the form is sent."
            },
            "name": {
              "type": "string",
              "description": "A privacy page's operator: who runs the app (pages.<page>.operator)."
            },
            "country": {
              "type": "string",
              "description": "The operator's country."
            },
            "hosting": {
              "type": "string",
              "description": "Where the app is hosted, as a phrase: \"in the EU\", \"in Stockholm\"."
            },
            "results": {
              "type": "string",
              "description": "A calculator section's results heading."
            },
            "label": {
              "type": "string",
              "description": "A dashboard tile's label."
            },
            "fields": {
              "type": "object",
              "description": "A calculator section's fields' labels and help.",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "help": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "consent": {
      "title": "Consent bar",
      "type": "object",
      "description": "The consent bar's words, when the app asks for consent (analytics that need it, or custom code): the sentence, and the two buttons.",
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string",
          "description": "The sentence that says what the yes is for."
        },
        "accept": {
          "type": "string",
          "description": "The button that says yes."
        },
        "decline": {
          "type": "string",
          "description": "The button that says no."
        }
      }
    },
    "assistant": {
      "title": "Ask, the assistant",
      "type": "object",
      "description": "Ask, the assistant in the app: its visible texts, in the app's language (who gets it is smithable.auth.yml's; its voice smithable.ux.yml's).",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "The panel's name, \"Ask\" by default, e.g. Nova."
        },
        "greeting": {
          "type": "string",
          "description": "The first line it shows."
        },
        "placeholder": {
          "type": "string",
          "description": "The question box's placeholder."
        },
        "about": {
          "type": "string",
          "description": "One sentence of what it is for, shown under the greeting and given to the model."
        }
      }
    },
    "menus": {
      "title": "Menu headings",
      "type": "object",
      "description": "A named menu's heading: { admin: { label: Administration } }.",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          }
        }
      }
    },
    "actions": {
      "title": "Actions",
      "type": "object",
      "description": "An action's words, by its name in smithable.yml: { resolve: { label: Mark as resolved, help: Closes the case for good. } }. The label is its button and its page's title, else its name in words; the help is the button's tooltip and a line under its dialog's title; confirm is the question an action with confirm: true asks first, with {field}, {reference}, {reference.field} and {title} of the record as it is.",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          },
          "help": {
            "type": "string"
          },
          "confirm": {
            "type": "string",
            "description": "The question an action with confirm: true asks before it runs, e.g. Send invoice {number} to {client.email}?"
          }
        }
      }
    },
    "outgoing": {
      "title": "Mails",
      "type": "object",
      "description": "An outgoing mail's words, by its name in smithable.yml: { bookingMade: { subject: Your booking, text: Thank you! } }. The record follows the text.",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "subject": {
            "type": "string",
            "description": "The mail's subject; else the record's title."
          },
          "text": {
            "type": "string",
            "description": "A sentence or two above the record's details."
          }
        }
      }
    }
  }
}
