feat: add formatMenuConfig prop for per-item format submenu control#409
Open
hryhoriiK97 wants to merge 6 commits into
Open
feat: add formatMenuConfig prop for per-item format submenu control#409hryhoriiK97 wants to merge 6 commits into
hryhoriiK97 wants to merge 6 commits into
Conversation
…arkdownTextInput Co-authored-by: Cursor <cursoragent@cursor.com>
252f84a to
b643a8b
Compare
08b82ae to
d7d92e8
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new formatMenuConfig prop to EnrichedMarkdownTextInput to allow per-item visibility control within the native “Format” context-menu submenu (bold/italic/underline/strikethrough/spoiler/link) across iOS, Android, and macOS, while preserving existing behavior via defaults.
Changes:
- Introduces
FormatMenuConfigTS types, normalizes defaults in the JS wrapper, and plumbs the prop through the codegen native component interface. - Implements per-item visibility filtering in native context menu builders on iOS/macOS and Android.
- Documents the new prop in
docs/API_REFERENCE.md(plus an unrelated example app Podfile.lock checksum update).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-enriched-markdown/src/index.tsx | Re-exports the new FormatMenuConfig type from the public entrypoint. |
| packages/react-native-enriched-markdown/src/EnrichedMarkdownTextInputNativeComponent.ts | Adds FormatMenuConfigInternal and a new required native prop formatMenuConfig for codegen. |
| packages/react-native-enriched-markdown/src/EnrichedMarkdownTextInput.tsx | Adds the public formatMenuConfig prop, docs, and normalization to full boolean defaults before passing to native. |
| packages/react-native-enriched-markdown/ios/input/EnrichedMarkdownTextInput+Internal.h | Defines ENRMFormatMenuConfig and exposes -formatMenuConfig accessor. |
| packages/react-native-enriched-markdown/ios/input/EnrichedMarkdownTextInput+ContextMenu.mm | Filters Format submenu items based on formatMenuConfig (iOS + macOS paths). |
| packages/react-native-enriched-markdown/ios/input/EnrichedMarkdownTextInput.mm | Stores/updates _formatMenuConfig from Fabric props and exposes accessor. |
| packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/input/toolbar/InputContextMenu.kt | Adds FormatMenuConfig and filters Android Format submenu items by style type. |
| packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputManager.kt | Adds the formatMenuConfig React prop setter to update the Android context menu config. |
| docs/API_REFERENCE.md | Documents formatMenuConfig, its defaults, and an example usage. |
| apps/example/ios/Podfile.lock | Updates several pod checksums (appears unrelated to the feature scope). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why?
Adds a new
formatMenuConfigprop toEnrichedMarkdownTextInputthat lets consumers control the visibility of individual items inside the "Format" submenu:bold,italic,underline,strikethrough,spoiler,linkAll fields default to
true, so existing behavior is preserved when the prop is omitted.Platforms: iOS, Android, macOS
Testing
Screenshots
Screen.Recording.2026-06-19.at.12.06.30.mov
PR Checklist