site.mochott.block

Record representing a custom block that can be inserted into articles by any user.

Repository @tokimeki.blue did:plc:4tr5dqti7nmu6g2czpthntak namespace authority
Details · record, key tid
Kindrecord
Record keytid
Authoritymochott.site
Indexed
cid bafyreiasuuadjixmnnadqxtydvrd3lmffkrker55iy6jyiahukoikjosyy

Checks

Valid
  • unlimited-string defs.fieldDef.properties.typeNo maxLength, maxGraphemes or format limits this string.
  • large-string defs.main.record.properties.cssmaxLength is over 20 KB. Use a blob for content that large.
  • large-string defs.main.record.properties.htmlmaxLength is over 20 KB. Use a blob for content that large.
JSONDownload
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "fieldDef": {
      "description": "Definition of a single configurable field within a custom block.",
      "properties": {
        "default": {
          "description": "Default value for the field.",
          "maxLength": 5000,
          "type": "string"
        },
        "description": {
          "description": "Help text shown to users when editing the field.",
          "maxGraphemes": 200,
          "maxLength": 1000,
          "type": "string"
        },
        "key": {
          "description": "Unique identifier for the field, used as {{key}} in HTML/CSS templates.",
          "maxLength": 64,
          "type": "string"
        },
        "label": {
          "description": "Display label shown to users in the editor.",
          "maxGraphemes": 50,
          "maxLength": 200,
          "type": "string"
        },
        "options": {
          "description": "Available options for select-type fields.",
          "items": {
            "ref": "#selectOption",
            "type": "ref"
          },
          "maxLength": 50,
          "type": "array"
        },
        "required": {
          "description": "Whether this field must be filled in.",
          "type": "boolean"
        },
        "type": {
          "description": "Input type for the field.",
          "knownValues": [
            "text",
            "textarea",
            "color",
            "image",
            "url",
            "number",
            "select",
            "boolean"
          ],
          "type": "string"
        }
      },
      "required": [
        "key",
        "label",
        "type"
      ],
      "type": "object"
    },
    "main": {
      "description": "Record representing a custom block that can be inserted into articles by any user.",
      "key": "tid",
      "record": {
        "properties": {
          "category": {
            "description": "Category for marketplace organization.",
            "maxLength": 100,
            "type": "string"
          },
          "createdAt": {
            "description": "Timestamp when the block was created.",
            "format": "datetime",
            "type": "string"
          },
          "css": {
            "description": "Scoped CSS for the block. Uses {{fieldKey}} placeholders for dynamic values like colors.",
            "maxLength": 50000,
            "type": "string"
          },
          "description": {
            "description": "Short description of the block's purpose and usage.",
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          },
          "fields": {
            "description": "Field definitions for user-configurable parameters.",
            "items": {
              "ref": "#fieldDef",
              "type": "ref"
            },
            "maxLength": 20,
            "type": "array"
          },
          "html": {
            "description": "HTML template. Uses {{fieldKey}} placeholders for dynamic values.",
            "maxLength": 50000,
            "type": "string"
          },
          "name": {
            "description": "Display name of the block.",
            "maxGraphemes": 50,
            "maxLength": 500,
            "type": "string"
          },
          "preview": {
            "accept": [
              "image/png",
              "image/jpeg",
              "image/webp"
            ],
            "description": "Preview thumbnail image for the block marketplace.",
            "maxSize": 500000,
            "type": "blob"
          },
          "updatedAt": {
            "description": "Timestamp when the block was last updated.",
            "format": "datetime",
            "type": "string"
          },
          "version": {
            "description": "Version number, incremented on each update.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "html",
          "css",
          "fields",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "selectOption": {
      "description": "A single option for a select-type field.",
      "properties": {
        "label": {
          "description": "Display label for this option.",
          "maxGraphemes": 50,
          "maxLength": 200,
          "type": "string"
        },
        "value": {
          "description": "The stored value when this option is selected.",
          "maxLength": 200,
          "type": "string"
        }
      },
      "required": [
        "value",
        "label"
      ],
      "type": "object"
    }
  },
  "description": "A reusable custom block definition. Contains an HTML template, scoped CSS, and field definitions for user-configurable parameters.",
  "id": "site.mochott.block",
  "lexicon": 1,
  "revision": 1
}