MishkaCmsCoreWeb.UIAdapters.Review (Mishka CMS Core v0.0.1)

Copy Markdown View Source

The UI adapter for the builder's Review panel — the editor's own look, over Gervaz's behaviour.

The two axes, and which one this is

Gervaz separates them deliberately: a template decides WHERE things go, an adapter decides HOW they look. MishkaCmsCoreWeb.Templates.ReviewComments and …ReviewCommentForm are the templates; this is the paint. Splitting them is what lets the Review panel look like the editor rather than like an admin table dropped into a sidebar, without either one reimplementing what Gervaz already does.

Fallback is the point

use MishkaGervaz.Behaviours.UIAdapter, fallback: … emits a defdelegate for every one of the ~90 components in the behaviour and then lets this module override any of them. Everything not written here — every input type, every upload control, every pagination button, the empty state, the spinner — is MishkaGervaz.UIAdapters.Tailwind's, unchanged, and starts working the day the Review panel starts using it.

So the list below is not "the components Review needs". It is "the components whose stock version looked wrong in a 360px sidebar":

  • badge/1 — the type and status chips. The stock badge is a table cell's; these are the editor's own chip idiom, and the type has to be legible at a glance because the counter counts one of them.
  • textarea/1 and select/1 — the composer's two fields, at the editor's control height and radius rather than a form page's.
  • button/1 — the editor's buttons, and the reason MishkaCmsCoreWeb.UIAdapters.Admin has one too: the fallback renders any icon name that is not a heroicon as an empty span.
  • empty_state/1 — the sheet is 360px wide; the stock empty state is built for a page.

Add to this list only when the stock version is genuinely wrong here. Every override is a piece of Gervaz that stops improving on its own.

A chip's colour arrives as a whole class from tone_classes/1 rather than a style attribute: CSP has no nonce for an attribute, so the policy in MishkaCmsCore.Runtime.Plugs.SecurityHeaders can only close style-src-attr by there being none. Each tone is written out per clause because Tailwind reads source text — an interpolated class name gets no rule at all, which is what MishkaCmsWeb.InterpolatedClassTest guards.

Summary

Functions

A type or status chip, in the editor's chip idiom rather than a table cell's.

A Review button.

Nothing here yet, at sidebar width — the stock one is built for a page.

What kind of note it is. Short list, so a plain select rather than a search.

The note itself. One field, at the editor's control height.

Functions

alert(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.alert/1.

archive_toggle(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.archive_toggle/1.

array_fields(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.array_fields/1.

badge(assigns)

A type or status chip, in the editor's chip idiom rather than a table cell's.

Attributes

  • label (:string) - Defaults to nil.
  • variant (:atom) - Defaults to :tag.
  • dot (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

bulk_action_bar(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.bulk_action_bar/1.

bulk_action_button(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.bulk_action_button/1.

button(assigns)

A Review button.

The same reason MishkaCmsCoreWeb.UIAdapters.Admin carries one: the fallback renders any icon name that is not a heroicon as an empty span, and the label has to reach the DOM either way.

Attributes

  • label (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • type (:string) - Defaults to "button".
  • icon (:string) - Defaults to nil.
  • variant (:atom) - Defaults to :default.
  • Global attributes are accepted. Supports all globals plus: ["phx-click", "phx-target", "phx-value-id", "phx-value-event", "phx-value-values", "data-confirm", "disabled"].

cell_array(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_array/1.

cell_avatars(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_avatars/1.

cell_bars(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_bars/1.

cell_code(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_code/1.

cell_date(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_date/1.

cell_datetime(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_datetime/1.

cell_empty(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_empty/1.

cell_number(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_number/1.

cell_stacked(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_stacked/1.

cell_stats(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_stats/1.

cell_tags(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_tags/1.

cell_text(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.cell_text/1.

checkbox(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.checkbox/1.

combobox(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.combobox/1.

copy_button(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.copy_button/1.

date_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.date_input/1.

date_range_container(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.date_range_container/1.

datetime_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.datetime_input/1.

empty_state(assigns)

Nothing here yet, at sidebar width — the stock one is built for a page.

Attributes

  • message (:string) - Defaults to nil.
  • icon (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

error_state(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.error_state/1.

field_error(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.field_error/1.

field_group(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.field_group/1.

field_wrapper(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.field_wrapper/1.

filter_reset_button(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.filter_reset_button/1.

form_container(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.form_container/1.

form_footer(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.form_footer/1.

form_header(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.form_header/1.

icon(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.icon/1.

json_editor(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.json_editor/1.

load_more_select(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.load_more_select/1.

loading_state(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.loading_state/1.

multi_select(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.multi_select/1.

nested_fields(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.nested_fields/1.

number_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.number_input/1.

pagination_container(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.pagination_container/1.

pagination_nav_button(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.pagination_nav_button/1.

pagination_page_button(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.pagination_page_button/1.

password_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.password_input/1.

range_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.range_input/1.

search_select(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.search_select/1.

select(assigns)

What kind of note it is. Short list, so a plain select rather than a search.

Attributes

  • field (:any) - Defaults to nil.
  • name (:string) - Defaults to nil.
  • value (:any) - Defaults to nil.
  • options (:list) - Defaults to [].
  • label (:string) - Defaults to nil.
  • prompt (:string) - Defaults to nil.
  • required (:boolean) - Defaults to false.
  • disabled (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • errors (:list) - Defaults to [].
  • Global attributes are accepted.

spinner(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.spinner/1.

step_indicator(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.step_indicator/1.

step_navigation(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.step_navigation/1.

string_list_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.string_list_input/1.

table(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.table/1.

table_header(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.table_header/1.

td(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.td/1.

template_switcher(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.template_switcher/1.

template_switcher_button(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.template_switcher_button/1.

text_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.text_input/1.

textarea(assigns)

The note itself. One field, at the editor's control height.

Attributes

  • field (:any) - Defaults to nil.
  • name (:string) - Defaults to nil.
  • value (:any) - Defaults to nil.
  • label (:string) - Defaults to nil.
  • placeholder (:string) - Defaults to nil.
  • rows (:any) - Defaults to 3.
  • required (:boolean) - Defaults to false.
  • disabled (:boolean) - Defaults to false.
  • readonly (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • errors (:list) - Defaults to [].
  • Global attributes are accepted.

th(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.th/1.

toggle_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.toggle_input/1.

tr(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.tr/1.

upload_dropzone(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.upload_dropzone/1.

upload_existing_file(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.upload_existing_file/1.

upload_file_input(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.upload_file_input/1.

upload_preview(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.upload_preview/1.

upload_progress(assigns)

Callback implementation for MishkaGervaz.Behaviours.UIAdapter.upload_progress/1.