StatifierBlocks.ViewModel.PaletteGroup (StatifierBlocks v0.23.0)

Copy Markdown View Source

One palette section: palette entries sharing entry.group, sorted by entry.order then entry.label (ADR-0005 decision 10's grouping rule).

An entry is a block type or a recipe (ADR-0005 clause 1C), and it says which in :kind. :name is the name in whichever of the palette's two maps it came from - the two are separate namespaces, so the pair {kind, name} is what identifies an entry and :name alone is not. A type entry also carries :type_name, unchanged, because a type's name IS its type_name; a recipe carries no such key, having no type_name at all.

Summary

Types

entry()

@type entry() :: %{
  :kind => kind(),
  :name => String.t(),
  :module => module(),
  :entry => StatifierBlocks.BlockType.palette_entry(),
  optional(:type_name) => StatifierBlocks.Block.type_name()
}

kind()

@type kind() :: :type | :recipe

t()

@type t() :: %StatifierBlocks.ViewModel.PaletteGroup{
  entries: [entry()],
  name: String.t()
}