Tiptapex.Schema.Document (Tiptapex v0.1.0)

Copy Markdown View Source

An Ecto.Type for Tiptap/ProseMirror JSON documents.

Stores the document as a map (:map column / jsonb in Postgres) and accepts either an already-decoded map or a JSON string — the latter is what arrives through a hidden-input form field (sync={{:hidden_input, field}} on tiptapex_editor/1).

schema "articles" do
  field :body, Tiptapex.Schema.Document
end

Only available when :ecto is present (it is an optional dependency).

Summary

Functions

Callback implementation for Ecto.Type.embed_as/1.

Callback implementation for Ecto.Type.equal?/2.

Functions

embed_as(_)

Callback implementation for Ecto.Type.embed_as/1.

equal?(term1, term2)

Callback implementation for Ecto.Type.equal?/2.