CKEditor5.Helpers (ckeditor5_phoenix v1.16.1)

View Source

Common helper functions for CKEditor5 components.

Summary

Functions

Assigns a unique ID if one is not already present in assigns. Generates a random UUID-based ID only when :id key is missing.

Checks if a given version string is in semantic versioning format (e.g., "1.0.0").

Maps all keys in a map to strings.

Parses a style string into a map.

Serializes a map of styles into a CSS string. Converts a map of styles into a string suitable for inline CSS. Example: %{color: "red", "font-size": "16px"} becomes "color: red; font-size: 16px".

Functions

assign_id_if_missing(assigns, prefix)

Assigns a unique ID if one is not already present in assigns. Generates a random UUID-based ID only when :id key is missing.

is_semver_version?(version)

Checks if a given version string is in semantic versioning format (e.g., "1.0.0").

map_keys_to_strings(map)

Maps all keys in a map to strings.

parse_style(style)

Parses a style string into a map.

serialize_styles_map(styles_map)

Serializes a map of styles into a CSS string. Converts a map of styles into a string suitable for inline CSS. Example: %{color: "red", "font-size": "16px"} becomes "color: red; font-size: 16px".