Kotoba.Collab (Kotoba v0.5.0)

Copy Markdown View Source

Collaboration for Kotoba with Phoenix as the document authority.

Import kotoba/collab once in the application's JavaScript, mount Kotoba.Collab.Channel on an application socket, and pass token/3 to the component's collab attribute. See the Collaboration guide.

Summary

Functions

Reads the current durably accepted content and revision for a form commit.

Reads the exact accepted revision posted by a collaboration form.

Makes short-lived join credentials from the LiveView's authenticated user.

Applies backend operations through the same validation and persistence path.

Functions

content(supervisor, document_id)

Reads the current durably accepted content and revision for a form commit.

content(supervisor, document_id, map)

Reads the exact accepted revision posted by a collaboration form.

token(socket_or_endpoint, document_id, opts)

Makes short-lived join credentials from the LiveView's authenticated user.

Options: :user (required), :role (:write or :read), :socket (the socket's path, "/kotoba/socket" by default) and :max_channels (that socket's :max_channels_per_transport, 100 by default).

transact(supervisor, document_id, operations_or_transaction, opts \\ [])

Applies backend operations through the same validation and persistence path.