MishkaCmsCore.Runtime.PageBuilder.Marketplace.Token (Mishka CMS Core v0.0.1)

Copy Markdown View Source

One design token — the validated shape both the Mock adapter and any real backend must produce.

usage is how many places in the site currently reference the token; the Studio sorts and dims by it, so an unused token is visibly unused. custom? marks a token the team added rather than one the theme shipped with, which the CSS generator highlights.

Summary

Functions

A sample %MishkaCmsCore.Runtime.PageBuilder.Marketplace.Token{} populated from defaults + type-based fallbacks.

Whether a token matches a category filter — "all", "custom", or a category name.

Builds a token, raising on an invalid one — seeds are compile-time data, not user input.

Types

t()

@type t() :: %MishkaCmsCore.Runtime.PageBuilder.Marketplace.Token{
  category: String.t(),
  custom?: boolean() | nil,
  glyph: String.t() | nil,
  key: String.t(),
  label: String.t(),
  usage: integer() | nil,
  value: String.t()
}

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

A sample %MishkaCmsCore.Runtime.PageBuilder.Marketplace.Token{} populated from defaults + type-based fallbacks.

keys()

keys(field)

matches?(token, category)

@spec matches?(t(), String.t()) :: boolean()

Whether a token matches a category filter — "all", "custom", or a category name.

new!(attrs)

@spec new!(map()) :: t()

Builds a token, raising on an invalid one — seeds are compile-time data, not user input.