PhiaUi.Components.Collab.CollabEditor (phia_ui v0.1.17)

Copy Markdown View Source

Composite collaborative editor widget.

Composes the full collaboration experience: status bar, TipTap editor, cursor overlay, thread sidebar, floating composer, and version badge. This is the "just give me a collaborative editor" convenience component.

Example

<.collab_editor
  id="doc-editor"
  doc_id="doc-123"
  current_user={%{id: "u1", name: "Alice", color: "#E53E3E", avatar_url: nil}}
  users={@online_users}
  threads={@threads}
  typing_users={@typing_users}
  connection_status={@connection_status}
/>

Summary

Functions

Renders a complete collaborative editing experience.

Functions

collab_editor(assigns)

Renders a complete collaborative editing experience.

Composes status bar, editor, cursors, threads, and version history into a single widget. Toggle features via boolean attrs.

Attributes

  • id (:string) (required)
  • doc_id (:string) (required)
  • current_user (:map) (required)
  • users (:list) - Defaults to [].
  • threads (:list) - Defaults to [].
  • typing_users (:list) - Defaults to [].
  • versions (:list) - Defaults to [].
  • notifications (:list) - Defaults to [].
  • connection_status (:atom) - Defaults to :connected. Must be one of :connected, :reconnecting, or :offline.
  • cursors (:list) - Defaults to [].
  • show_threads (:boolean) - Defaults to true.
  • show_cursors (:boolean) - Defaults to true.
  • show_version_history (:boolean) - Defaults to false.
  • show_notifications (:boolean) - Defaults to false.
  • show_status_bar (:boolean) - Defaults to true.
  • editor_placeholder (:string) - Defaults to "Start writing...".
  • editor_min_height (:string) - Defaults to "400px".
  • active_version_id (:string) - Defaults to nil.
  • version_changes (:list) - Defaults to [].
  • last_saved_at (:any) - Defaults to nil.
  • has_unsaved (:boolean) - Defaults to false.
  • mention_suggestions (:list) - Defaults to [].
  • show_mention_dropdown (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • toolbar_extra - Extra toolbar items injected into the editor toolbar.