PhoenixKit.Modules.Publishing.Web.Editor.Versions (phoenix_kit v1.7.71)

Copy Markdown View Source

Version management functionality for the publishing editor.

Handles version switching, creation, migration, and version-related UI state management.

Summary

Functions

Creates a new version from a source version. Returns {:ok, socket} or {:error, socket} for use in handle_event.

Handles when a version is deleted by another editor.

Reads a specific version of a post.

With variant versioning, all versions are editable since they're independent attempts. This function always returns false - no version locking.

Functions

apply_version_switch(socket, version, version_post, form_builder_fn)

Applies a version switch to the socket.

create_version_from_source(socket)

Creates a new version from a source version. Returns {:ok, socket} or {:error, socket} for use in handle_event.

handle_version_deleted(socket, deleted_version)

Handles when a version is deleted by another editor.

read_version_post(socket, version)

Reads a specific version of a post.

viewing_older_version?(current_version, available_versions, current_language)

With variant versioning, all versions are editable since they're independent attempts. This function always returns false - no version locking.