PhiaUi.Components.Editor.Formatting (phia_ui v0.1.17)

Copy Markdown View Source

Editor Formatting Suite — 16 components for text formatting controls.

Provides font selection, color pickers, alignment, spacing, and typographic controls for the PhiaUI rich text editor.

Summary

Functions

Background/highlight color palette.

Strip all marks from selection.

Apply drop-cap to first letter.

Dropdown with font family preview (sans/serif/mono).

Dropdown 8-72pt with common font sizes.

Copy formatting, apply to next selection.

2-button: indent/outdent.

Dropdown: tight/normal/wide letter spacing.

Dropdown: 1.0/1.15/1.5/2.0 line height.

Before/after spacing controls.

Toggle small-caps styling.

Toggle subscript mark.

Toggle superscript mark.

4-button alignment group: left/center/right/justify.

Cycle: original → UPPER → lower → Title.

Foreground color palette with swatches.

Functions

bg_color_picker(assigns)

Background/highlight color palette.

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • value (:string) - Defaults to nil.
  • colors (:list) - Defaults to ["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#f3f3f3", "#ffffff", "#980000", "#ff0000", "#ff9900", "#ffff00", "#00ff00", "#00ffff", "#4a86e8", "#0000ff", "#9900ff", "#ff00ff"].
  • class (:string) - Defaults to nil.

clear_formatting_button(assigns)

Strip all marks from selection.

Attributes

  • editor_id (:string) (required)
  • class (:string) - Defaults to nil.

drop_cap_toggle(assigns)

Apply drop-cap to first letter.

Attributes

  • editor_id (:string) (required)
  • active (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.

font_family_selector(assigns)

Dropdown with font family preview (sans/serif/mono).

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • value (:string) - Defaults to "sans-serif".
  • class (:string) - Defaults to nil.

font_size_selector(assigns)

Dropdown 8-72pt with common font sizes.

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • value (:any) - Defaults to nil.
  • class (:string) - Defaults to nil.

format_painter(assigns)

Copy formatting, apply to next selection.

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • active (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.

indent_controls(assigns)

2-button: indent/outdent.

Attributes

  • editor_id (:string) (required)
  • class (:string) - Defaults to nil.

letter_spacing_selector(assigns)

Dropdown: tight/normal/wide letter spacing.

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • value (:string) - Defaults to "normal".
  • class (:string) - Defaults to nil.

line_height_selector(assigns)

Dropdown: 1.0/1.15/1.5/2.0 line height.

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • value (:string) - Defaults to "1.5".
  • class (:string) - Defaults to nil.

paragraph_spacing(assigns)

Before/after spacing controls.

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • space_before (:string) - Defaults to "0".
  • space_after (:string) - Defaults to "0.5em".
  • class (:string) - Defaults to nil.

small_caps_button(assigns)

Toggle small-caps styling.

Attributes

  • editor_id (:string) (required)
  • active (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.

subscript_button(assigns)

Toggle subscript mark.

Attributes

  • editor_id (:string) (required)
  • active (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.

superscript_button(assigns)

Toggle superscript mark.

Attributes

  • editor_id (:string) (required)
  • active (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.

text_align_group(assigns)

4-button alignment group: left/center/right/justify.

Attributes

  • editor_id (:string) (required)
  • active_alignment (:string) - Defaults to "left".
  • class (:string) - Defaults to nil.

text_case_toggle(assigns)

Cycle: original → UPPER → lower → Title.

Attributes

  • editor_id (:string) (required)
  • current_case (:atom) - Defaults to :original.
  • class (:string) - Defaults to nil.

text_color_picker(assigns)

Foreground color palette with swatches.

Attributes

  • id (:string) (required)
  • editor_id (:string) (required)
  • value (:string) - Defaults to nil.
  • colors (:list) - Defaults to ["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#f3f3f3", "#ffffff", "#980000", "#ff0000", "#ff9900", "#ffff00", "#00ff00", "#00ffff", "#4a86e8", "#0000ff", "#9900ff", "#ff00ff"].
  • class (:string) - Defaults to nil.