Minga.Extension.Panel (Minga v0.1.0)

Copy Markdown View Source

ETS-backed registry for extension-owned panels in the editor.

Extensions register panels with structured content blocks (tables, key-value pairs, text, trees, progress bars). The Layer 2 emit pipeline reads this registry and encodes the content for the frontend, which renders it with native widgets.

Summary

Types

A content block in a panel.

A registered panel entry.

Panel position in the editor layout.

Panel size specification.

Types

content_block()

@type content_block() ::
  {:text, String.t()}
  | {:styled_text, [{String.t(), non_neg_integer(), keyword()}]}
  | {:table, map()}
  | {:key_value, [{String.t(), String.t()}]}
  | {:separator}
  | {:progress, map()}
  | {:tree, map()}

A content block in a panel.

entry()

@type entry() :: %{
  extension: atom(),
  panel_id: term(),
  title: String.t(),
  position: position(),
  size: size(),
  visible: boolean(),
  content: [content_block()]
}

A registered panel entry.

position()

@type position() :: :bottom | :right | :float

Panel position in the editor layout.

size()

@type size() :: {:percent, 1..100} | {:lines, pos_integer()}

Panel size specification.

table()

@type table() :: atom()

Functions

all()

@spec all() :: [entry()]

all(table)

@spec all(table()) :: [entry()]

empty?()

@spec empty?() :: boolean()

empty?(table)

@spec empty?(table()) :: boolean()

hide(extension_name, panel_id)

@spec hide(atom(), term()) :: :ok

remove(extension_name, panel_id)

@spec remove(atom(), term()) :: :ok

remove(table, extension_name, panel_id)

@spec remove(table(), atom(), term()) :: :ok

remove_all(extension_name)

@spec remove_all(atom()) :: :ok

remove_all(table, extension_name)

@spec remove_all(table(), atom()) :: :ok

set(extension_name, panel_id, opts)

@spec set(atom(), term(), map()) :: :ok

set(table, extension_name, panel_id, opts)

@spec set(table(), atom(), term(), map()) :: :ok

show(extension_name, panel_id)

@spec show(atom(), term()) :: :ok

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

unregister_source(arg1)

visible()

@spec visible() :: [entry()]

visible(table)

@spec visible(table()) :: [entry()]