Skip to content

Native toolbar mobile support#737

Open
mbarta wants to merge 8 commits intomainfrom
native-toolbar-sync
Open

Native toolbar mobile support#737
mbarta wants to merge 8 commits intomainfrom
native-toolbar-sync

Conversation

@mbarta
Copy link
Member

@mbarta mbarta commented Feb 17, 2026

This PR adds native Strada bridge support code for Lexxy's toolbar, selection, and attachments so native Android/iOS apps can render their own toolbar UI while the editor handles the content.

  • Attribute syncing: Extracts a Native class that emits attributes-change events on every editor state update and focus, reporting active formatting (bold, italic, highlight, link, etc.) so the native toolbar can reflect the current selection state
  • Selection freeze/thaw: Adds freezeSelection()/thawSelection() on the editor element so native dialogs (link editing, etc.) can preserve the user's selection while a modal is open. Expands collapsed selections within links to select the full link text before freezing
  • Highlight colors: Dispatches resolved highlight color palettes (highlight-colors event) on initialization so the native side knows which swatches to display, including computed RGB values for CSS custom properties
  • Code language picker: Intercepts the native mousedown to emit a code-language-picker-open event, letting native apps show their own picker UI. Adds setCodeLanguage command for applying the selection back
  • Bridge-managed attachments: insertPendingAttachment() creates upload nodes without a uploadUrl, skipping DirectUpload. Returns a handle with setAttributes(), setUploadProgress(), and remove() for the native side to drive the upload lifecycle
  • Disable Autocapitalize: prevents mobile keyboards from capitalizing input

This support functionality needs to be paired with a Strada controller and native mobile implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments