react-native-enriched-markdown-scaffold 0.7.4-scaffold.9 → 1.0.2-scaffold.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -8
- package/ReactNativeEnrichedMarkdown.podspec +82 -73
- package/android/build.gradle +188 -1
- package/android/consumer-rules.pro +1 -1
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownManagerDelegate.java +27 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownManagerInterface.java +7 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextInputManagerDelegate.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextInputManagerInterface.java +8 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerDelegate.java +27 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerInterface.java +7 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/EventEmitters.cpp +223 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/EventEmitters.h +183 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.cpp +65 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.h +1086 -61
- package/android/src/main/baseline-prof.txt +1 -1
- package/android/src/main/cpp/jni-adapter.cpp +74 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdown.kt +351 -13
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownInternalText.kt +62 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownManager.kt +85 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownText.kt +160 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextLayoutManager.kt +10 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextManager.kt +76 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/MeasurementStore.kt +126 -10
- package/android/src/main/java/com/swmansion/enriched/markdown/events/CopyPressEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/events/CopyRequestEvent.kt +28 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/events/LinkLayoutEvent.kt +36 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/events/SelectionChangeEvent.kt +43 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputManager.kt +54 -4
- package/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputView.kt +923 -462
- package/android/src/main/java/com/swmansion/enriched/markdown/input/MarkdownClipboard.kt +42 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/BlockEditCoordinator.kt +196 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/ClipboardCoordinator.kt +73 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/EditContext.kt +19 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/EditPipeline.kt +248 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/EditSession.kt +52 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/InputConnectionWrapper.kt +108 -7
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/LinkCoordinator.kt +69 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/MarkdownTextWatcher.kt +3 -3
- package/android/src/main/java/com/swmansion/enriched/markdown/input/editing/MentionCoordinator.kt +118 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnChangeStateEvent.kt +26 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnContextMenuItemPressEvent.kt +26 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnInputKeyPressEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/events/OnPasteEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/BlockStore.kt +254 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/FormattingStore.kt +80 -87
- package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/InputFormatter.kt +109 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/InputParser.kt +116 -22
- package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/MarkdownSerializer.kt +167 -38
- package/android/src/main/java/com/swmansion/enriched/markdown/input/formatting/RangeEditAdjustment.kt +149 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/layout/InputEventEmitter.kt +66 -5
- package/android/src/main/java/com/swmansion/enriched/markdown/input/layout/InputMeasurementStore.kt +4 -2
- package/android/src/main/java/com/swmansion/enriched/markdown/input/model/BlockRange.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/model/BlockType.kt +48 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/model/FormattingRange.kt +9 -4
- package/android/src/main/java/com/swmansion/enriched/markdown/input/model/InputFormatterStyle.kt +39 -2
- package/android/src/main/java/com/swmansion/enriched/markdown/input/model/MathAtom.kt +20 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/model/MathChipStyle.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/input/model/MutableRangeBounds.kt +11 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputBulletSpan.kt +82 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputHeadingSpan.kt +58 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputListItemSpacingSpan.kt +37 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/spans/InputOrderedListMarkerSpan.kt +63 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/BlockHandler.kt +54 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/HeadingBlockHandler.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/OrderedListBlockHandler.kt +38 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/styles/UnorderedListBlockHandler.kt +37 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/input/toolbar/InputContextMenu.kt +8 -26
- package/android/src/main/java/com/swmansion/enriched/markdown/parser/MarkdownASTNode.kt +1 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/parser/Parser.kt +1 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/BlockStyleContext.kt +9 -2
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/BlockquoteRenderer.kt +100 -12
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/CodeBlockRenderer.kt +16 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/HeadingRenderer.kt +4 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/LinkRenderer.kt +37 -7
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListContextManager.kt +2 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListItemRenderer.kt +74 -18
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListRenderer.kt +43 -4
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/NodeRenderer.kt +9 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/SoftBreakRenderer.kt +16 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/SpanStyleCache.kt +35 -28
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/BaseListSpan.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/BlockquoteSpan.kt +174 -24
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeBackgroundSpan.kt +20 -82
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeBlockSpan.kt +13 -16
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeSpan.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/EmphasisSpan.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/ImageSpan.kt +182 -46
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/InlineChipPainter.kt +140 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/LinkChipSpans.kt +177 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/LinkSpan.kt +1 -6
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/ListItemSpacingSpan.kt +33 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/ListMarkerAnchorSpan.kt +38 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/OrderedListSpan.kt +2 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/StrongSpan.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/TaskListSpan.kt +3 -2
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/UnorderedListSpan.kt +3 -2
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/BlockquoteStyle.kt +6 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/CodeBlockStyle.kt +26 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/ImageStyle.kt +7 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/InlineMathStyle.kt +16 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/LinkStyle.kt +36 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/LinkVariantEntry.kt +7 -3
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/ListStyle.kt +4 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/MathStyle.kt +3 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/StyleConfig.kt +13 -4
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/TableStyle.kt +6 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/CodeBlockHighlighter.kt +90 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/CodeBlockNode.kt +57 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/FeatureFlags.kt +1 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/MarkdownSegment.kt +9 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/MarkdownViewManagerUtils.kt +84 -7
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/ReadableMapExtensions.kt +3 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/RenderedSegment.kt +10 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/SegmentSignature.kt +1 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/StreamingMarkdownFilter.kt +83 -5
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/serialization/MarkdownASTSerializer.kt +4 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/input/MarkdownStyleParser.kt +74 -44
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/input/PasteTextUtils.kt +52 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/ImageCache.kt +26 -3
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/ImageDownloader.kt +22 -9
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/LocalImageLoader.kt +161 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/conversion/HTMLGenerator.kt +2 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/conversion/MarkdownExtractor.kt +6 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/extensions/TextPaintExtensions.kt +23 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/interaction/CheckboxTouchHelper.kt +7 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/interaction/TaskListTapUtils.kt +41 -21
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/span/BlockSpacing.kt +15 -8
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/HeadlessActionMode.kt +88 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/LinkLayoutCollector.kt +100 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/LinkLongPressMovementMethod.kt +58 -27
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/SelectionActionMode.kt +72 -16
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/view/SelectionChangeReporter.kt +232 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/views/BlockMenuOptions.kt +64 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/views/CodeBlockContainerView.kt +414 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/views/ContextMenuPopup.kt +9 -6
- package/android/src/main/java/com/swmansion/enriched/markdown/views/CopyGlyph.kt +101 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/views/TableContainerView.kt +61 -11
- package/android/src/main/jni/CMakeLists.txt +53 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownContainerShadowNode.cpp +10 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownContainerShadowNode.h +11 -2
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextShadowNode.cpp +10 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextShadowNode.h +12 -2
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextState.cpp +9 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextState.h +24 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/conversions.h +16 -0
- package/android/src/math/java/com/swmansion/enriched/markdown/input/math/MathChipControllerImpl.kt +21 -4
- package/android/src/math/java/com/swmansion/enriched/markdown/renderer/MathInlineRenderer.kt +8 -2
- package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathChipSpan.kt +1 -1
- package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathInlineSpan.kt +13 -6
- package/android/src/math/java/com/swmansion/enriched/markdown/spans/MathMeasureHelper.kt +2 -1
- package/android/src/math/java/com/swmansion/enriched/markdown/views/MathContainerView.kt +26 -8
- package/cpp/highlight/CodeBlockHighlighter.cpp +284 -0
- package/cpp/highlight/CodeBlockHighlighter.hpp +66 -0
- package/cpp/highlight/CodeBlockLanguages.cpp +138 -0
- package/cpp/highlight/CodeBlockLanguages.hpp +25 -0
- package/cpp/highlight/HighlightGrammars.hpp +28 -0
- package/cpp/highlight/code_highlight_podspec.rb +211 -0
- package/cpp/highlight/gen-registry.mjs +155 -0
- package/cpp/highlight/grammar-versions.json +159 -0
- package/cpp/highlight/vendor/generated/generated_queries.h +1665 -0
- package/cpp/highlight/vendor/generated/generated_registry.cpp +59 -0
- package/cpp/parser/MD4CParser.cpp +173 -61
- package/cpp/parser/MD4CParser.hpp +1 -0
- package/cpp/parser/MarkdownASTNode.hpp +2 -1
- package/cpp/wasm/ASTSerializer.cpp +2 -0
- package/cpp/wasm/build.sh +1 -0
- package/cpp/wasm/md4c_wasm.cpp +3 -1
- package/docs/ACCESSIBILITY.md +14 -2
- package/docs/API_REFERENCE.md +405 -12
- package/docs/BREAKING_CHANGES.md +129 -0
- package/docs/CODE_HIGHLIGHT.md +133 -0
- package/docs/COPY_OPTIONS.md +61 -3
- package/docs/ELEMENTS_STRUCTURE.md +52 -4
- package/docs/IMAGE_CACHING.md +30 -0
- package/docs/INPUT.md +110 -11
- package/docs/LATEX_MATH.md +87 -45
- package/docs/MACOS.md +1 -1
- package/docs/MARKDOWN_STREAMING.md +27 -1
- package/docs/MENTIONS.md +8 -1
- package/docs/NATIVE_ASSETS.md +127 -0
- package/docs/RTL.md +1 -1
- package/docs/STYLES.md +73 -6
- package/docs/TESTING.md +112 -0
- package/docs/TEXT.md +18 -6
- package/docs/WEB.md +4 -1
- package/ios/EnrichedMarkdown.h +7 -0
- package/ios/EnrichedMarkdown.mm +583 -76
- package/ios/EnrichedMarkdownText.h +7 -0
- package/ios/EnrichedMarkdownText.mm +299 -73
- package/ios/attachments/ENRMImageAttachment.h +9 -0
- package/ios/attachments/ENRMImageAttachment.m +143 -40
- package/ios/attachments/ENRMMathInlineAttachment+macOS.m +2 -1
- package/ios/attachments/ENRMMathInlineAttachment.h +5 -0
- package/ios/attachments/ENRMMathInlineAttachment.m +50 -82
- package/ios/attachments/ENRMMathInlineAttachmentShared.h +2 -0
- package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/EventEmitters.cpp +223 -0
- package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/EventEmitters.h +183 -0
- package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.cpp +65 -0
- package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.h +1086 -61
- package/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/RCTComponentViewHelpers.h +181 -2
- package/ios/input/ENRMAutoLinkDetector.h +2 -1
- package/ios/input/ENRMAutoLinkDetector.mm +79 -41
- package/ios/input/ENRMBlockEditCoordinator.h +71 -0
- package/ios/input/ENRMBlockEditCoordinator.mm +195 -0
- package/ios/input/ENRMBlockRange.h +28 -0
- package/ios/input/ENRMBlockRange.mm +30 -0
- package/ios/input/ENRMBlockStore.h +56 -0
- package/ios/input/ENRMBlockStore.mm +275 -0
- package/ios/input/ENRMClipboardCoordinator.h +45 -0
- package/ios/input/ENRMClipboardCoordinator.mm +120 -0
- package/ios/input/ENRMDetectorPipeline.h +2 -1
- package/ios/input/ENRMEditPipeline.h +76 -0
- package/ios/input/ENRMEditPipeline.mm +228 -0
- package/ios/input/ENRMEditSession.h +36 -0
- package/ios/input/ENRMEditSession.mm +63 -0
- package/ios/input/ENRMFormattingStore.h +17 -0
- package/ios/input/ENRMFormattingStore.mm +95 -105
- package/ios/input/ENRMInputBlockType.h +91 -0
- package/ios/input/ENRMInputBlockType.mm +5 -0
- package/ios/input/ENRMInputDecorationDrawer.h +18 -0
- package/ios/input/ENRMInputEventEmitter.h +56 -0
- package/ios/input/ENRMInputEventEmitter.mm +308 -0
- package/ios/input/ENRMInputFormatter.h +29 -69
- package/ios/input/ENRMInputFormatter.mm +216 -124
- package/ios/input/ENRMInputFormatterStyle.h +99 -0
- package/ios/input/ENRMInputFormatterStyle.mm +188 -0
- package/ios/input/ENRMInputLayoutManager.h +9 -0
- package/ios/input/ENRMInputLayoutManager.mm +30 -0
- package/ios/input/ENRMInputListMarkerDrawer.h +32 -0
- package/ios/input/ENRMInputListMarkerDrawer.mm +426 -0
- package/ios/input/ENRMInputParser.h +5 -6
- package/ios/input/ENRMInputParser.mm +461 -178
- package/ios/input/ENRMInputRemend.mm +2 -2
- package/ios/input/ENRMInputStyleStateBuilder.h +40 -0
- package/ios/input/ENRMInputStyleStateBuilder.mm +60 -0
- package/ios/input/ENRMInputTextView.mm +103 -8
- package/ios/input/ENRMInputTypingAttributesController.h +42 -0
- package/ios/input/ENRMInputTypingAttributesController.mm +203 -0
- package/ios/input/ENRMLinkCoordinator.h +41 -0
- package/ios/input/ENRMLinkCoordinator.mm +89 -0
- package/ios/input/ENRMMarkdownSerializer.h +29 -5
- package/ios/input/ENRMMarkdownSerializer.mm +170 -48
- package/ios/input/ENRMMathAtom.h +26 -0
- package/ios/input/ENRMMathAtom.mm +12 -0
- package/ios/input/ENRMMentionCoordinator.h +45 -0
- package/ios/input/ENRMMentionCoordinator.mm +167 -0
- package/ios/input/ENRMRangeEditAdjustment.h +38 -0
- package/ios/input/ENRMRangeEditAdjustment.mm +91 -0
- package/ios/input/ENRMRangeStoreUtils.h +39 -0
- package/ios/input/EnrichedMarkdownTextInput+ContextMenu.mm +6 -6
- package/ios/input/EnrichedMarkdownTextInput+Internal.h +11 -3
- package/ios/input/EnrichedMarkdownTextInput.h +7 -1
- package/ios/input/EnrichedMarkdownTextInput.mm +1089 -1023
- package/ios/input/InputStylePropsUtils.h +109 -68
- package/ios/input/internals/EnrichedMarkdownTextInputShadowNode.mm +2 -1
- package/ios/input/styles/ENRMBlockHandler.h +46 -0
- package/ios/input/styles/ENRMHeadingBlockHandler.h +15 -0
- package/ios/input/styles/ENRMHeadingBlockHandler.mm +38 -0
- package/ios/input/styles/ENRMOrderedListBlockHandler.h +14 -0
- package/ios/input/styles/ENRMOrderedListBlockHandler.mm +48 -0
- package/ios/input/styles/ENRMUnorderedListBlockHandler.h +15 -0
- package/ios/input/styles/ENRMUnorderedListBlockHandler.mm +51 -0
- package/ios/internals/ENRMViewFreeMeasurement.h +331 -0
- package/ios/internals/EnrichedMarkdownShadowNode.h +1 -3
- package/ios/internals/EnrichedMarkdownShadowNode.mm +16 -20
- package/ios/internals/EnrichedMarkdownTextShadowNode.h +1 -3
- package/ios/internals/EnrichedMarkdownTextShadowNode.mm +15 -20
- package/ios/internals/MeasurementCache.h +41 -9
- package/ios/internals/ShadowMeasurementUtils.h +63 -58
- package/ios/math/ENRMMathChipController.h +74 -0
- package/ios/math/ENRMMathChipController.mm +476 -0
- package/ios/math/ENRMRaTeXBridge.swift +27 -6
- package/ios/parser/ENRMMarkdownParser.h +1 -8
- package/ios/parser/ENRMMarkdownParser.mm +2 -11
- package/ios/parser/MarkdownASTNode.h +2 -1
- package/ios/parser/MarkdownParserBridge.mm +4 -0
- package/ios/renderer/AttributedRenderer.m +20 -2
- package/ios/renderer/BaseRenderer.h +17 -2
- package/ios/renderer/BaseRenderer.m +30 -0
- package/ios/renderer/BlockquoteRenderer.h +1 -1
- package/ios/renderer/BlockquoteRenderer.m +144 -35
- package/ios/renderer/CodeBlockRenderer.h +1 -1
- package/ios/renderer/CodeBlockRenderer.m +27 -23
- package/ios/renderer/CodeRenderer.h +1 -1
- package/ios/renderer/CodeRenderer.m +3 -1
- package/ios/renderer/ENRMImageRenderer.h +1 -1
- package/ios/renderer/ENRMImageRenderer.m +5 -1
- package/ios/renderer/ENRMMathInlineRenderer.h +1 -1
- package/ios/renderer/ENRMMathInlineRenderer.m +6 -1
- package/ios/renderer/ENRMSpoilerRenderer.h +1 -1
- package/ios/renderer/ENRMSpoilerRenderer.m +3 -1
- package/ios/renderer/EmphasisRenderer.h +1 -1
- package/ios/renderer/EmphasisRenderer.m +3 -1
- package/ios/renderer/HeadingRenderer.h +1 -1
- package/ios/renderer/HeadingRenderer.m +13 -6
- package/ios/renderer/HighlightRenderer.h +1 -1
- package/ios/renderer/HighlightRenderer.m +3 -1
- package/ios/renderer/LinkRenderer.h +1 -1
- package/ios/renderer/LinkRenderer.m +50 -16
- package/ios/renderer/ListItemRenderer.h +13 -1
- package/ios/renderer/ListItemRenderer.m +102 -44
- package/ios/renderer/ListRenderer.h +2 -2
- package/ios/renderer/ListRenderer.m +63 -25
- package/ios/renderer/ParagraphRenderer.h +1 -1
- package/ios/renderer/ParagraphRenderer.m +16 -8
- package/ios/renderer/RenderContext.h +10 -0
- package/ios/renderer/RenderContext.m +44 -0
- package/ios/renderer/RendererFactory.m +14 -0
- package/ios/renderer/StrikethroughRenderer.h +1 -1
- package/ios/renderer/StrikethroughRenderer.m +3 -1
- package/ios/renderer/StrongRenderer.h +1 -1
- package/ios/renderer/StrongRenderer.m +3 -1
- package/ios/renderer/SubscriptRenderer.h +1 -1
- package/ios/renderer/SubscriptRenderer.m +3 -1
- package/ios/renderer/SuperscriptRenderer.h +1 -1
- package/ios/renderer/SuperscriptRenderer.m +3 -1
- package/ios/renderer/TextRenderer.h +2 -2
- package/ios/renderer/TextRenderer.m +3 -1
- package/ios/renderer/ThematicBreakRenderer.h +1 -1
- package/ios/renderer/ThematicBreakRenderer.m +3 -1
- package/ios/renderer/UnderlineRenderer.h +1 -1
- package/ios/renderer/UnderlineRenderer.m +3 -1
- package/ios/styles/StyleConfig.h +42 -0
- package/ios/styles/StyleConfig.mm +216 -0
- package/ios/utils/BlockquoteBorder.h +6 -0
- package/ios/utils/BlockquoteBorder.m +249 -52
- package/ios/utils/CodeBackground.m +3 -65
- package/ios/utils/CodeBlockBackground.m +16 -2
- package/ios/utils/ENRMAtomicSize.h +65 -0
- package/ios/utils/ENRMBlockMenu.h +66 -0
- package/ios/utils/ENRMChipDrawing.h +24 -0
- package/ios/utils/ENRMChipDrawing.m +83 -0
- package/ios/utils/ENRMCodeBlockContent.h +37 -0
- package/ios/utils/ENRMCodeBlockContent.mm +79 -0
- package/ios/utils/ENRMCodeBlockHighlighter.h +37 -0
- package/ios/utils/ENRMCodeBlockHighlighter.mm +51 -0
- package/ios/utils/ENRMFeatureFlags.h +7 -0
- package/ios/utils/ENRMImageDownloader.h +11 -1
- package/ios/utils/ENRMImageDownloader.m +60 -16
- package/ios/utils/ENRMLinkChip.h +70 -0
- package/ios/utils/ENRMLinkChip.m +213 -0
- package/ios/utils/ENRMLinkLayout.h +50 -0
- package/ios/utils/ENRMLinkLayout.m +45 -0
- package/ios/utils/ENRMLocalImageLoader.h +31 -0
- package/ios/utils/ENRMLocalImageLoader.m +68 -0
- package/ios/utils/ENRMMathFallback.h +26 -0
- package/ios/utils/ENRMMathFallback.m +18 -0
- package/ios/utils/ENRMSelectionChange.h +120 -0
- package/ios/utils/ENRMSelectionChange.m +282 -0
- package/ios/utils/ENRMTextViewSetup.h +35 -17
- package/ios/utils/EditMenuUtils+macOS.m +4 -1
- package/ios/utils/EditMenuUtils.h +35 -6
- package/ios/utils/EditMenuUtils.m +188 -11
- package/ios/utils/HTMLGenerator.m +2 -1
- package/ios/utils/ImageRequestHeaderUtils.h +35 -0
- package/ios/utils/LastElementUtils.h +1 -0
- package/ios/utils/ListMarkerDrawer.m +29 -42
- package/ios/utils/MarkdownASTSerializer.m +4 -0
- package/ios/utils/MarkdownAccessibilityElementBuilder.m +3 -1
- package/ios/utils/MarkdownExtractor.m +2 -1
- package/ios/utils/ParagraphStyleUtils.h +5 -0
- package/ios/utils/ParagraphStyleUtils.m +77 -17
- package/ios/utils/RTFExportUtils.m +2 -0
- package/ios/utils/RenderedMarkdownSegment.h +13 -1
- package/ios/utils/RenderedMarkdownSegment.m +20 -0
- package/ios/utils/SegmentRenderer.m +17 -4
- package/ios/utils/StreamingMarkdownFilter.h +11 -1
- package/ios/utils/StreamingMarkdownFilter.m +98 -2
- package/ios/utils/StylePropsUtils.h +110 -1
- package/ios/utils/TaskListTapUtils.m +24 -0
- package/ios/utils/TextViewLayoutManager.mm +3 -0
- package/ios/views/ENRMCodeBlockContainerView.h +60 -0
- package/ios/views/ENRMCodeBlockContainerView.m +569 -0
- package/ios/views/ENRMMathContainerView.h +23 -0
- package/ios/views/ENRMMathContainerView.m +87 -20
- package/ios/views/TableContainerView.h +32 -0
- package/ios/views/TableContainerView.m +291 -175
- package/jest.d.ts +1 -0
- package/jest.js +5 -0
- package/lib/module/EnrichedMarkdownNativeComponent.ts +203 -1
- package/lib/module/EnrichedMarkdownTextInput.js +84 -5
- package/lib/module/EnrichedMarkdownTextInput.js.map +1 -1
- package/lib/module/EnrichedMarkdownTextInputNativeComponent.ts +78 -5
- package/lib/module/EnrichedMarkdownTextNativeComponent.ts +204 -1
- package/lib/module/headingDefaults.js +34 -0
- package/lib/module/headingDefaults.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/jest/index.js +205 -0
- package/lib/module/jest/index.js.map +1 -0
- package/lib/module/native/EnrichedMarkdownText.js +199 -15
- package/lib/module/native/EnrichedMarkdownText.js.map +1 -1
- package/lib/module/normalizeMarkdownStyle.js +98 -23
- package/lib/module/normalizeMarkdownStyle.js.map +1 -1
- package/lib/module/normalizeMarkdownStyle.web.js +73 -22
- package/lib/module/normalizeMarkdownStyle.web.js.map +1 -1
- package/lib/module/normalizeMarkdownTextInputStyle.js +62 -15
- package/lib/module/normalizeMarkdownTextInputStyle.js.map +1 -1
- package/lib/module/normalizeMenuItem.js +1 -1
- package/lib/module/utils/textInputState.js +26 -0
- package/lib/module/utils/textInputState.js.map +1 -0
- package/lib/module/web/EnrichedMarkdownText.js +15 -8
- package/lib/module/web/EnrichedMarkdownText.js.map +1 -1
- package/lib/module/web/parseMarkdown.js +4 -3
- package/lib/module/web/parseMarkdown.js.map +1 -1
- package/lib/module/web/renderers/InlineRenderers.js +102 -3
- package/lib/module/web/renderers/InlineRenderers.js.map +1 -1
- package/lib/module/web/renderers/ListRenderers.js +7 -2
- package/lib/module/web/renderers/ListRenderers.js.map +1 -1
- package/lib/module/web/renderers/index.js +7 -4
- package/lib/module/web/renderers/index.js.map +1 -1
- package/lib/module/web/styles.js +101 -6
- package/lib/module/web/styles.js.map +1 -1
- package/lib/module/web/utils.js +14 -0
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web/wasm/md4c.js +0 -0
- package/lib/module/web/wasm/md4c.js.map +1 -1
- package/lib/typescript/src/EnrichedMarkdownNativeComponent.d.ts +185 -2
- package/lib/typescript/src/EnrichedMarkdownNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/EnrichedMarkdownTextInput.d.ts +94 -9
- package/lib/typescript/src/EnrichedMarkdownTextInput.d.ts.map +1 -1
- package/lib/typescript/src/EnrichedMarkdownTextInputNativeComponent.d.ts +69 -5
- package/lib/typescript/src/EnrichedMarkdownTextInputNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts +185 -2
- package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/headingDefaults.d.ts +9 -0
- package/lib/typescript/src/headingDefaults.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +2 -2
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/jest/index.d.ts +6 -0
- package/lib/typescript/src/jest/index.d.ts.map +1 -0
- package/lib/typescript/src/native/EnrichedMarkdownText.d.ts +5 -5
- package/lib/typescript/src/native/EnrichedMarkdownText.d.ts.map +1 -1
- package/lib/typescript/src/normalizeMarkdownStyle.d.ts.map +1 -1
- package/lib/typescript/src/normalizeMarkdownStyle.web.d.ts.map +1 -1
- package/lib/typescript/src/normalizeMarkdownTextInputStyle.d.ts +19 -5
- package/lib/typescript/src/normalizeMarkdownTextInputStyle.d.ts.map +1 -1
- package/lib/typescript/src/types/MarkdownStyle.d.ts +122 -5
- package/lib/typescript/src/types/MarkdownStyle.d.ts.map +1 -1
- package/lib/typescript/src/types/MarkdownStyleInternal.d.ts +39 -0
- package/lib/typescript/src/types/MarkdownStyleInternal.d.ts.map +1 -1
- package/lib/typescript/src/types/MarkdownTextProps.d.ts +207 -10
- package/lib/typescript/src/types/MarkdownTextProps.d.ts.map +1 -1
- package/lib/typescript/src/types/MarkdownTextProps.web.d.ts +60 -1
- package/lib/typescript/src/types/MarkdownTextProps.web.d.ts.map +1 -1
- package/lib/typescript/src/types/events.d.ts +85 -0
- package/lib/typescript/src/types/events.d.ts.map +1 -1
- package/lib/typescript/src/utils/textInputState.d.ts +24 -0
- package/lib/typescript/src/utils/textInputState.d.ts.map +1 -0
- package/lib/typescript/src/web/EnrichedMarkdownText.d.ts +1 -1
- package/lib/typescript/src/web/EnrichedMarkdownText.d.ts.map +1 -1
- package/lib/typescript/src/web/parseMarkdown.d.ts +1 -1
- package/lib/typescript/src/web/parseMarkdown.d.ts.map +1 -1
- package/lib/typescript/src/web/renderers/InlineRenderers.d.ts.map +1 -1
- package/lib/typescript/src/web/renderers/ListRenderers.d.ts.map +1 -1
- package/lib/typescript/src/web/renderers/index.d.ts +2 -1
- package/lib/typescript/src/web/renderers/index.d.ts.map +1 -1
- package/lib/typescript/src/web/styles.d.ts +2 -1
- package/lib/typescript/src/web/styles.d.ts.map +1 -1
- package/lib/typescript/src/web/types.d.ts +10 -2
- package/lib/typescript/src/web/types.d.ts.map +1 -1
- package/lib/typescript/src/web/utils.d.ts +4 -0
- package/lib/typescript/src/web/utils.d.ts.map +1 -1
- package/package.json +36 -9
- package/postinstall.mjs +131 -0
- package/ratex-version.json +21 -0
- package/src/EnrichedMarkdownNativeComponent.ts +203 -1
- package/src/EnrichedMarkdownTextInput.tsx +159 -8
- package/src/EnrichedMarkdownTextInputNativeComponent.ts +78 -5
- package/src/EnrichedMarkdownTextNativeComponent.ts +204 -1
- package/src/headingDefaults.ts +21 -0
- package/src/index.tsx +15 -0
- package/src/index.web.tsx +6 -1
- package/src/jest/index.tsx +236 -0
- package/src/native/EnrichedMarkdownText.tsx +260 -11
- package/src/normalizeMarkdownStyle.ts +117 -16
- package/src/normalizeMarkdownStyle.web.ts +76 -15
- package/src/normalizeMarkdownTextInputStyle.ts +110 -35
- package/src/normalizeMenuItem.ts +1 -1
- package/src/types/MarkdownStyle.ts +125 -5
- package/src/types/MarkdownStyleInternal.ts +51 -0
- package/src/types/MarkdownTextProps.ts +215 -10
- package/src/types/MarkdownTextProps.web.ts +62 -1
- package/src/types/events.ts +90 -0
- package/src/utils/textInputState.ts +35 -0
- package/src/web/EnrichedMarkdownText.tsx +26 -5
- package/src/web/parseMarkdown.ts +6 -2
- package/src/web/renderers/InlineRenderers.tsx +116 -3
- package/src/web/renderers/ListRenderers.tsx +14 -2
- package/src/web/renderers/index.tsx +6 -2
- package/src/web/styles.ts +114 -5
- package/src/web/types.ts +10 -1
- package/src/web/utils.ts +9 -0
- package/src/web/wasm/md4c.js +0 -0
- package/vendor-grammars.mjs +511 -0
- package/vendor-ratex.mjs +173 -0
- package/app.plugin.js +0 -2
- package/plugin/build/withAndroidMath.js +0 -19
- package/plugin/build/withIosMath.js +0 -28
- package/plugin/build/withReactNativeEnrichedMarkdown.js +0 -11
- package/plugin/src/withAndroidMath.ts +0 -24
- package/plugin/src/withIosMath.ts +0 -35
- package/plugin/src/withReactNativeEnrichedMarkdown.ts +0 -17
- package/plugin/tsconfig.build.json +0 -16
|
@@ -1,7 +1,45 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
import type { ColorValue, HostInstance, ViewProps, ViewStyle, TextStyle } from 'react-native';
|
|
2
3
|
import type { MarkdownStyle, Md4cFlags } from './MarkdownStyle';
|
|
3
4
|
import type { AccessibilityLabels } from './AccessibilityLabels';
|
|
4
|
-
import type { LinkPressEvent, LinkLongPressEvent, TaskListItemPressEvent } from './events';
|
|
5
|
+
import type { LinkPressEvent, LinkLongPressEvent, TaskListItemPressEvent, CopyPressEvent, CopyEvent, SelectionChangeEvent } from './events';
|
|
6
|
+
/** Imperative handle of `EnrichedMarkdownText`, reached through its `ref`. */
|
|
7
|
+
export interface EnrichedMarkdownTextInstance {
|
|
8
|
+
/**
|
|
9
|
+
* Clears the text selection (and any long-pressed block) and fires
|
|
10
|
+
* `onSelectionChange` with `active: false`.
|
|
11
|
+
* @platform ios, android
|
|
12
|
+
*/
|
|
13
|
+
clearSelection: () => void;
|
|
14
|
+
measure: HostInstance['measure'];
|
|
15
|
+
measureInWindow: HostInstance['measureInWindow'];
|
|
16
|
+
measureLayout: HostInstance['measureLayout'];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A rect in dp, relative to the component's content box (inside any
|
|
20
|
+
* `containerStyle` padding).
|
|
21
|
+
*/
|
|
22
|
+
export interface LinkRect {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}
|
|
28
|
+
/** Layout of one rendered link, passed to `renderLinkDecoration`. */
|
|
29
|
+
export interface LinkDecorationInfo {
|
|
30
|
+
/** Position of the link in the document (0-based) — stable key for a link. */
|
|
31
|
+
index: number;
|
|
32
|
+
url: string;
|
|
33
|
+
/** The link's visible text. */
|
|
34
|
+
text: string;
|
|
35
|
+
/**
|
|
36
|
+
* Anchor rect. Native: the drawn chip (glyphs + padding) of the link's last
|
|
37
|
+
* line fragment. Web: the link's inline box.
|
|
38
|
+
*/
|
|
39
|
+
rect: LinkRect;
|
|
40
|
+
/** Every line fragment of the link (several when it wraps). Web: `[rect]`. */
|
|
41
|
+
rects: LinkRect[];
|
|
42
|
+
}
|
|
5
43
|
/**
|
|
6
44
|
* Public context menu item. Each item includes a JS-side `onPress` callback
|
|
7
45
|
* that is called when the user taps the item in the selection context menu.
|
|
@@ -52,24 +90,35 @@ export interface SelectionMenuPluralLabels {
|
|
|
52
90
|
* Controls the built-in items added to the native text selection menu and
|
|
53
91
|
* lets you localize their labels.
|
|
54
92
|
*
|
|
55
|
-
* Each item accepts an object: `{ enabled }` toggles visibility
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
93
|
+
* Each item accepts an object: `{ enabled }` toggles visibility and `label`
|
|
94
|
+
* overrides the English default. Wire `label` to your i18n library to match
|
|
95
|
+
* the rest of your app's UI. Items and labels apply to the main text selection
|
|
96
|
+
* menu as well as the table, math and code block copy menus.
|
|
97
|
+
*
|
|
98
|
+
* `copy.enabled`, `copy.format` and `systemItems` are ignored on macOS.
|
|
60
99
|
*
|
|
61
100
|
* @platform ios, android, macos
|
|
62
101
|
*/
|
|
63
102
|
export interface SelectionMenuConfig {
|
|
64
103
|
/**
|
|
65
|
-
* The
|
|
66
|
-
*
|
|
104
|
+
* The "Copy" item.
|
|
105
|
+
* - `enabled`: `false` removes it from the text selection menu, the table /
|
|
106
|
+
* math / code block menus and the code block VoiceOver copy action.
|
|
107
|
+
* - `format`: `'rich'` copies rich text (plain + HTML, plus RTF on iOS) from
|
|
108
|
+
* text selections and the raw content from blocks; `'markdown'` copies
|
|
109
|
+
* Markdown as plain text everywhere the item appears (inline math becomes
|
|
110
|
+
* `$…$`, math blocks `$$…$$`, code blocks are fenced). The code block header
|
|
111
|
+
* button and VoiceOver action always copy the raw code.
|
|
112
|
+
* @default { enabled: true, label: "Copy", format: "rich" }
|
|
67
113
|
*/
|
|
68
114
|
copy?: {
|
|
115
|
+
enabled?: boolean;
|
|
69
116
|
label?: string;
|
|
117
|
+
format?: 'rich' | 'markdown';
|
|
70
118
|
};
|
|
71
119
|
/**
|
|
72
|
-
* The built-in "Copy as Markdown" action
|
|
120
|
+
* The built-in "Copy as Markdown" action, in the text selection menu and in
|
|
121
|
+
* the table / math / code block menus.
|
|
73
122
|
* @default { enabled: true, label: "Copy as Markdown" }
|
|
74
123
|
*/
|
|
75
124
|
copyAsMarkdown?: {
|
|
@@ -87,6 +136,25 @@ export interface SelectionMenuConfig {
|
|
|
87
136
|
label?: string;
|
|
88
137
|
pluralLabels?: SelectionMenuPluralLabels;
|
|
89
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* Which system items the text selection menu keeps.
|
|
141
|
+
* - `'default'`: keep everything the OS adds (Select All, Look Up, Share,
|
|
142
|
+
* Translate, app text actions…), with Copy replaced by the built-in one.
|
|
143
|
+
* - `'none'`: drop every system item; the menu only holds the built-in items
|
|
144
|
+
* above and `contextMenuItems`.
|
|
145
|
+
* @default 'default'
|
|
146
|
+
* @platform ios, android
|
|
147
|
+
*/
|
|
148
|
+
systemItems?: 'default' | 'none';
|
|
149
|
+
/**
|
|
150
|
+
* The copy button in the code block header. `false` hides the button; the
|
|
151
|
+
* header and language label stay.
|
|
152
|
+
* @default { enabled: true }
|
|
153
|
+
* @platform ios, android, macos
|
|
154
|
+
*/
|
|
155
|
+
codeBlockCopyButton?: {
|
|
156
|
+
enabled?: boolean;
|
|
157
|
+
};
|
|
90
158
|
}
|
|
91
159
|
export interface StreamingConfig {
|
|
92
160
|
/**
|
|
@@ -98,8 +166,25 @@ export interface StreamingConfig {
|
|
|
98
166
|
* @platform ios, android
|
|
99
167
|
*/
|
|
100
168
|
tableMode?: 'hidden' | 'progressive';
|
|
169
|
+
/**
|
|
170
|
+
* Controls how a fenced code block whose closing fence has not arrived yet
|
|
171
|
+
* is handled during streaming.
|
|
172
|
+
* - `'hidden'`: hide the entire code block until its closing fence arrives.
|
|
173
|
+
* - `'progressive'` (default): show the code as it streams in with its header
|
|
174
|
+
* visible but non-interactive (copying is disabled); syntax highlighting is
|
|
175
|
+
* deferred until the closing fence arrives, so it appears once atomically.
|
|
176
|
+
* Only effective when `streamingAnimation` is `true`.
|
|
177
|
+
* @default 'progressive'
|
|
178
|
+
* @platform ios, android
|
|
179
|
+
*/
|
|
180
|
+
codeBlockMode?: 'hidden' | 'progressive';
|
|
101
181
|
}
|
|
102
182
|
export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
|
|
183
|
+
/**
|
|
184
|
+
* Imperative handle: `clearSelection()` plus the host `measure*` methods.
|
|
185
|
+
* @platform ios, android
|
|
186
|
+
*/
|
|
187
|
+
ref?: RefObject<EnrichedMarkdownTextInstance | null>;
|
|
103
188
|
/**
|
|
104
189
|
* Markdown content to render.
|
|
105
190
|
* @platform ios, android, web
|
|
@@ -137,6 +222,21 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
|
|
|
137
222
|
* @platform ios, android, web
|
|
138
223
|
*/
|
|
139
224
|
onLinkLongPress?: (event: LinkLongPressEvent) => void;
|
|
225
|
+
/**
|
|
226
|
+
* Renders a decoration (e.g. a badge or icon) over each link. The returned
|
|
227
|
+
* node is placed in an absolutely positioned box matching `info.rect` (the
|
|
228
|
+
* link's last line fragment, including chip padding) with
|
|
229
|
+
* `pointerEvents="box-none"`; position content relative to it (negative
|
|
230
|
+
* offsets overflow the box). Return `null` to leave a link undecorated.
|
|
231
|
+
*
|
|
232
|
+
* Native caveats: rects arrive from native after layout, so decorations
|
|
233
|
+
* appear one frame after the text; links inside tables (`flavor="github"`)
|
|
234
|
+
* are not reported; content overflowing the component bounds does not
|
|
235
|
+
* receive touches on Android. Toggling this prop between set and unset
|
|
236
|
+
* remounts the native view.
|
|
237
|
+
* @platform ios, android, web
|
|
238
|
+
*/
|
|
239
|
+
renderLinkDecoration?: (info: LinkDecorationInfo) => ReactNode | null;
|
|
140
240
|
/**
|
|
141
241
|
* Callback fired when a task list checkbox is tapped.
|
|
142
242
|
*
|
|
@@ -148,6 +248,61 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
|
|
|
148
248
|
* @platform ios, android, web
|
|
149
249
|
*/
|
|
150
250
|
onTaskListItemPress?: (event: TaskListItemPressEvent) => void;
|
|
251
|
+
/**
|
|
252
|
+
* Controls whether tapping a task list checkbox toggles its checked state.
|
|
253
|
+
*
|
|
254
|
+
* When `true` (default), tapping the checkbox toggles it and fires
|
|
255
|
+
* `onTaskListItemPress`. When `false`, the checkbox renders its markdown
|
|
256
|
+
* state read-only: the tap is fully inert — no visual toggle and no
|
|
257
|
+
* `onTaskListItemPress` emission. Text selection and links in the same row
|
|
258
|
+
* are unaffected.
|
|
259
|
+
*
|
|
260
|
+
* @default true
|
|
261
|
+
* @platform ios, android, web
|
|
262
|
+
*/
|
|
263
|
+
enableTaskListItemToggle?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Callback fired when code is copied from a fenced code block, via the header
|
|
266
|
+
* copy button, the long-press context-menu "Copy" action, or the VoiceOver
|
|
267
|
+
* copy action. Receives the copied code and its language. Does not fire for
|
|
268
|
+
* "Copy as Markdown", nor for the context-menu "Copy" when
|
|
269
|
+
* `selectionMenuConfig.copy.format` is `'markdown'`.
|
|
270
|
+
*
|
|
271
|
+
* Only fires when `flavor="github"` (the copy button is part of the GitHub
|
|
272
|
+
* flavor's container-based code block renderer).
|
|
273
|
+
* @platform ios, android, macos
|
|
274
|
+
*/
|
|
275
|
+
onCopyPress?: (event: CopyPressEvent) => void;
|
|
276
|
+
/**
|
|
277
|
+
* Takes over the "Copy" item of the text selection menu and of the table /
|
|
278
|
+
* math / code block menus. When set, native does **not** write the
|
|
279
|
+
* clipboard: it calls this with the copied content and the handler writes
|
|
280
|
+
* whatever it wants (e.g. with `expo-clipboard`). Overrides
|
|
281
|
+
* `selectionMenuConfig.copy.format`; `copy.enabled: false` still hides the
|
|
282
|
+
* item. "Copy as Markdown", the code block header button and the VoiceOver
|
|
283
|
+
* copy action are unaffected, and `onCopyPress` does not fire for an
|
|
284
|
+
* intercepted Copy.
|
|
285
|
+
* @platform ios, android
|
|
286
|
+
*/
|
|
287
|
+
onCopy?: (event: CopyEvent) => void;
|
|
288
|
+
/**
|
|
289
|
+
* Reports the text selection so the app can draw its own menu (pair it with
|
|
290
|
+
* `contextMenuHidden`). Fires at most once per frame while the selection
|
|
291
|
+
* changes, and with `active: false` once it is gone. With
|
|
292
|
+
* `contextMenuHidden`, a long press on a table / math / code block fires it
|
|
293
|
+
* too (`source` is the block kind, `whole: true`), since those blocks have no
|
|
294
|
+
* text selection of their own. Only one part of a component holds a
|
|
295
|
+
* selection at a time; clearing the selection of *other* components is up to
|
|
296
|
+
* the app (`ref.current.clearSelection()`).
|
|
297
|
+
*
|
|
298
|
+
* Rects are relative to the view that `ref.current.measureInWindow`
|
|
299
|
+
* measures — add that origin to position UI on screen. On iOS, `adjusting`
|
|
300
|
+
* is `true` while a selection handle is dragged: hide the menu until it is
|
|
301
|
+
* `false` again. Android reports every step of the drag instead (with
|
|
302
|
+
* `adjusting: false`), so debounce before showing a menu there.
|
|
303
|
+
* @platform ios, android
|
|
304
|
+
*/
|
|
305
|
+
onSelectionChange?: (event: SelectionChangeEvent) => void;
|
|
151
306
|
/**
|
|
152
307
|
* Controls whether the system link preview is shown on long press (iOS only).
|
|
153
308
|
*
|
|
@@ -161,6 +316,16 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
|
|
|
161
316
|
* @platform ios
|
|
162
317
|
*/
|
|
163
318
|
enableLinkPreview?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* When `true`, long-pressing a link selects its label and shows the
|
|
321
|
+
* selection edit menu, like a manual text selection, instead of the system
|
|
322
|
+
* link preview. Takes precedence over `enableLinkPreview` and
|
|
323
|
+
* `onLinkLongPress`.
|
|
324
|
+
*
|
|
325
|
+
* @default false
|
|
326
|
+
* @platform ios
|
|
327
|
+
*/
|
|
328
|
+
linkLongPressSelects?: boolean;
|
|
164
329
|
/**
|
|
165
330
|
* Controls text selection.
|
|
166
331
|
* - iOS: Controls text selection and link previews on long press.
|
|
@@ -253,6 +418,38 @@ export interface EnrichedMarkdownTextProps extends Omit<ViewProps, 'style'> {
|
|
|
253
418
|
* @platform ios, android
|
|
254
419
|
*/
|
|
255
420
|
contextMenuItems?: ContextMenuItem[];
|
|
421
|
+
/**
|
|
422
|
+
* HTTP headers to attach to remote image requests, e.g. a `Referer`
|
|
423
|
+
* required by CDN hotlink protection or an `Authorization` token.
|
|
424
|
+
*
|
|
425
|
+
* Headers participate in image cache identity, so the same URL requested
|
|
426
|
+
* with different headers is fetched and cached separately.
|
|
427
|
+
*
|
|
428
|
+
* Not supported on web — browsers don't allow custom headers on `<img>`
|
|
429
|
+
* requests.
|
|
430
|
+
* @platform ios, android
|
|
431
|
+
*/
|
|
432
|
+
imageRequestHeaders?: Record<string, string>;
|
|
433
|
+
/**
|
|
434
|
+
* Hides the text selection context menu. Text stays selectable (and stays
|
|
435
|
+
* reachable by TalkBack / VoiceOver) — only the menu is suppressed. Use
|
|
436
|
+
* `selectable={false}` instead if you want to disable selection itself.
|
|
437
|
+
*
|
|
438
|
+
* This hides the whole menu, including the custom items from
|
|
439
|
+
* `contextMenuItems` and the built-in items from `selectionMenuConfig`,
|
|
440
|
+
* since they all share one menu. It also covers the copy menus on table,
|
|
441
|
+
* math and code blocks.
|
|
442
|
+
*
|
|
443
|
+
* It does not suppress the system "Save to Camera Roll / Copy" sheet that
|
|
444
|
+
* UIKit shows when long-pressing an image.
|
|
445
|
+
*
|
|
446
|
+
* On Android no selection toolbar is created at all, so ROMs that draw
|
|
447
|
+
* their own (MIUI) stay hidden too. A selection made while this is on
|
|
448
|
+
* keeps no menu if it is turned off mid-selection; the next one gets it.
|
|
449
|
+
* @default false
|
|
450
|
+
* @platform ios, android, macos
|
|
451
|
+
*/
|
|
452
|
+
contextMenuHidden?: boolean;
|
|
256
453
|
/**
|
|
257
454
|
* Controls the built-in items added to the native text selection menu and
|
|
258
455
|
* lets you localize their labels. Custom app-provided actions are controlled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownTextProps.d.ts","sourceRoot":"","sources":["../../../../src/types/MarkdownTextProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"MarkdownTextProps.d.ts","sourceRoot":"","sources":["../../../../src/types/MarkdownTextProps.ts"],"names":[],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gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,cAAc,CAAC;CAC5D"}
|
|
@@ -1,6 +1,31 @@
|
|
|
1
|
-
import type { CSSProperties, HTMLAttributes } from 'react';
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { MarkdownStyle, Md4cFlags } from './MarkdownStyle';
|
|
3
3
|
import type { LinkPressEvent, LinkLongPressEvent, TaskListItemPressEvent } from './events';
|
|
4
|
+
/**
|
|
5
|
+
* A rect in dp, relative to the component's content box (inside any
|
|
6
|
+
* `containerStyle` padding).
|
|
7
|
+
*/
|
|
8
|
+
export interface LinkRect {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
/** Layout of one rendered link, passed to `renderLinkDecoration`. */
|
|
15
|
+
export interface LinkDecorationInfo {
|
|
16
|
+
/** Position of the link in the document (0-based) — stable key for a link. */
|
|
17
|
+
index: number;
|
|
18
|
+
url: string;
|
|
19
|
+
/** The link's visible text. */
|
|
20
|
+
text: string;
|
|
21
|
+
/**
|
|
22
|
+
* Anchor rect. Native: the drawn chip (glyphs + padding) of the link's last
|
|
23
|
+
* line fragment. Web: the link's inline box.
|
|
24
|
+
*/
|
|
25
|
+
rect: LinkRect;
|
|
26
|
+
/** Every line fragment of the link (several when it wraps). Web: `[rect]`. */
|
|
27
|
+
rects: LinkRect[];
|
|
28
|
+
}
|
|
4
29
|
export interface EnrichedMarkdownTextProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style' | 'dir'> {
|
|
5
30
|
/**
|
|
6
31
|
* Markdown content to render.
|
|
@@ -39,6 +64,21 @@ export interface EnrichedMarkdownTextProps extends Omit<HTMLAttributes<HTMLDivEl
|
|
|
39
64
|
* @platform ios, android, web
|
|
40
65
|
*/
|
|
41
66
|
onLinkLongPress?: (event: LinkLongPressEvent) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Renders a decoration (e.g. a badge or icon) over each link. The returned
|
|
69
|
+
* node is placed in an absolutely positioned box matching `info.rect` (the
|
|
70
|
+
* link's last line fragment, including chip padding) with
|
|
71
|
+
* `pointerEvents="box-none"`; position content relative to it (negative
|
|
72
|
+
* offsets overflow the box). Return `null` to leave a link undecorated.
|
|
73
|
+
*
|
|
74
|
+
* Native caveats: rects arrive from native after layout, so decorations
|
|
75
|
+
* appear one frame after the text; links inside tables (`flavor="github"`)
|
|
76
|
+
* are not reported; content overflowing the component bounds does not
|
|
77
|
+
* receive touches on Android. Toggling this prop between set and unset
|
|
78
|
+
* remounts the native view.
|
|
79
|
+
* @platform ios, android, web
|
|
80
|
+
*/
|
|
81
|
+
renderLinkDecoration?: (info: LinkDecorationInfo) => ReactNode | null;
|
|
42
82
|
/**
|
|
43
83
|
* Callback fired when a task list checkbox is tapped.
|
|
44
84
|
*
|
|
@@ -50,6 +90,25 @@ export interface EnrichedMarkdownTextProps extends Omit<HTMLAttributes<HTMLDivEl
|
|
|
50
90
|
* @platform ios, android, web
|
|
51
91
|
*/
|
|
52
92
|
onTaskListItemPress?: (event: TaskListItemPressEvent) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Controls whether tapping a task list checkbox toggles its checked state.
|
|
95
|
+
*
|
|
96
|
+
* When `true` (default), tapping the checkbox toggles it and fires
|
|
97
|
+
* `onTaskListItemPress`. When `false`, the checkbox renders its markdown
|
|
98
|
+
* state read-only: the tap is fully inert — no visual toggle and no
|
|
99
|
+
* `onTaskListItemPress` emission. Text selection and links in the same row
|
|
100
|
+
* are unaffected.
|
|
101
|
+
*
|
|
102
|
+
* On web the checkbox keeps its normal appearance and is marked
|
|
103
|
+
* `readOnly` / `aria-disabled` rather than `disabled`, so it stays visually
|
|
104
|
+
* consistent with iOS and Android. It is also made pointer-inert
|
|
105
|
+
* (`pointer-events: none`) so the browser cannot paint hover or active
|
|
106
|
+
* states on a checkbox that cannot be toggled.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
109
|
+
* @platform ios, android, web
|
|
110
|
+
*/
|
|
111
|
+
enableTaskListItemToggle?: boolean;
|
|
53
112
|
/**
|
|
54
113
|
* Controls text selection.
|
|
55
114
|
* - iOS: Controls text selection and link previews on long press.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownTextProps.web.d.ts","sourceRoot":"","sources":["../../../../src/types/MarkdownTextProps.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownTextProps.web.d.ts","sourceRoot":"","sources":["../../../../src/types/MarkdownTextProps.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf,8EAA8E;IAC9E,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CACrD,cAAc,CAAC,cAAc,CAAC,EAC9B,OAAO,GAAG,KAAK,CAChB;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,SAAS,GAAG,IAAI,CAAC;IACtE;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC9D;;;;;;;;;;;;;;;;;OAiBG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;CAC9B"}
|
|
@@ -9,6 +9,76 @@ export interface TaskListItemPressEvent {
|
|
|
9
9
|
checked: boolean;
|
|
10
10
|
text: string;
|
|
11
11
|
}
|
|
12
|
+
export interface CopyPressEvent {
|
|
13
|
+
code: string;
|
|
14
|
+
language: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Payload of `onCopy`: what the Copy item would have copied. With `onCopy`
|
|
18
|
+
* set, native writes nothing to the clipboard — the handler owns the write.
|
|
19
|
+
*/
|
|
20
|
+
export interface CopyEvent {
|
|
21
|
+
/** Which menu the Copy item belongs to. */
|
|
22
|
+
source: 'selection' | 'math' | 'table' | 'code';
|
|
23
|
+
/**
|
|
24
|
+
* Markdown of the copied content — what `copy.format: 'markdown'` writes.
|
|
25
|
+
* Text selections: the original source when `whole`, otherwise rebuilt from
|
|
26
|
+
* the rendered styles (falls back to `text`). Blocks: `$$…$$`, the table as
|
|
27
|
+
* Markdown, or the fenced code block.
|
|
28
|
+
*/
|
|
29
|
+
markdown: string;
|
|
30
|
+
/** Rendered text of the selection, or the block's raw content. */
|
|
31
|
+
text: string;
|
|
32
|
+
/**
|
|
33
|
+
* `true` when the selection covers the whole component, so `markdown` is the
|
|
34
|
+
* original source. Always `true` for blocks.
|
|
35
|
+
*/
|
|
36
|
+
whole: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A rect in dp, relative to the component's native view: add the origin from
|
|
40
|
+
* the component ref's `measureInWindow` to get window coordinates.
|
|
41
|
+
*/
|
|
42
|
+
export interface SelectionRect {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Payload of `onSelectionChange`: the current text selection, or a table /
|
|
50
|
+
* math / code block long-pressed while `contextMenuHidden` is on. Content
|
|
51
|
+
* fields carry what `onCopy` would receive for the same selection.
|
|
52
|
+
*/
|
|
53
|
+
export interface SelectionChangeEvent {
|
|
54
|
+
/** `false` once the selection is gone; every other field is then empty / zero. */
|
|
55
|
+
active: boolean;
|
|
56
|
+
/** `'selection'` for text; the block kind for a long-pressed block. */
|
|
57
|
+
source: CopyEvent['source'];
|
|
58
|
+
/** Rendered text of the selection, or the block's raw content. */
|
|
59
|
+
text: string;
|
|
60
|
+
/** Same as `CopyEvent.markdown` for this selection. */
|
|
61
|
+
markdown: string;
|
|
62
|
+
/** Same as `CopyEvent.whole`. Always `true` for blocks. */
|
|
63
|
+
whole: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Bounding box of the selection (full content width when it spans several
|
|
66
|
+
* lines); the block's frame for blocks.
|
|
67
|
+
*/
|
|
68
|
+
rect: SelectionRect;
|
|
69
|
+
/** Selected part of the first line (block: same as `rect`). */
|
|
70
|
+
startRect: SelectionRect;
|
|
71
|
+
/** Selected part of the last line (block: same as `rect`). */
|
|
72
|
+
endRect: SelectionRect;
|
|
73
|
+
/**
|
|
74
|
+
* `true` while a selection handle is dragged (or the loupe is held), with the
|
|
75
|
+
* selection as it was when the drag began; `false` again, with the new
|
|
76
|
+
* selection, once the finger lifts. Hide your menu while it is `true`.
|
|
77
|
+
* Always `false` on Android, which reports the selection continuously
|
|
78
|
+
* during the drag.
|
|
79
|
+
*/
|
|
80
|
+
adjusting: boolean;
|
|
81
|
+
}
|
|
12
82
|
/**
|
|
13
83
|
* Native-level context menu item config sent to the native component.
|
|
14
84
|
* Does not include the `onPress` callback — callbacks are managed on the JS side.
|
|
@@ -26,4 +96,19 @@ export interface OnContextMenuItemPressEvent {
|
|
|
26
96
|
selectionStart: number;
|
|
27
97
|
selectionEnd: number;
|
|
28
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Event payload fired by the native component when the user pastes while
|
|
101
|
+
* `interceptPaste` is on. Native does not touch the buffer — it only reports
|
|
102
|
+
* what the clipboard held. The handler must call `resolvePaste` exactly once,
|
|
103
|
+
* or the paste is dropped.
|
|
104
|
+
*/
|
|
105
|
+
export interface OnPasteEvent {
|
|
106
|
+
/** Plain text from the clipboard, verbatim, before the text view sees it. */
|
|
107
|
+
text: string;
|
|
108
|
+
/**
|
|
109
|
+
* Markdown flavor, set only when the copy source was an input of this
|
|
110
|
+
* component. iOS-only; Android always reports `''`.
|
|
111
|
+
*/
|
|
112
|
+
markdown: string;
|
|
113
|
+
}
|
|
29
114
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,2CAA2C;IAC3C,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,kFAAkF;IAClF,MAAM,EAAE,OAAO,CAAC;IAChB,uEAAuE;IACvE,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB,+DAA+D;IAC/D,SAAS,EAAE,aAAa,CAAC;IACzB,8DAA8D;IAC9D,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridges EnrichedMarkdownTextInput into React Native's TextInputState focus
|
|
3
|
+
* registry so it participates in RN's keyboard-dismiss behavior (issue #577).
|
|
4
|
+
*
|
|
5
|
+
* Registering a non-TextInput host component is safe: TextInputState's
|
|
6
|
+
* blurTextInput dispatches the built-in TextInput's "blur" command at the
|
|
7
|
+
* registered instance, and Fabric command dispatch is name-based — it works
|
|
8
|
+
* as long as the component ships a command with that name, which ours does.
|
|
9
|
+
*
|
|
10
|
+
* A deep import is required because the public TextInput.State API lacks the
|
|
11
|
+
* registerInput/focusInput/blurInput bookkeeping functions.
|
|
12
|
+
*/
|
|
13
|
+
import type { HostInstance } from 'react-native';
|
|
14
|
+
interface TextInputStateModule {
|
|
15
|
+
registerInput(input: HostInstance): void;
|
|
16
|
+
unregisterInput(input: HostInstance): void;
|
|
17
|
+
focusInput(input: HostInstance | null): void;
|
|
18
|
+
blurInput(input: HostInstance | null): void;
|
|
19
|
+
blurTextInput(input: HostInstance | null): void;
|
|
20
|
+
currentlyFocusedInput(): HostInstance | null;
|
|
21
|
+
}
|
|
22
|
+
export declare const TextInputState: TextInputStateModule;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=textInputState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textInputState.d.ts","sourceRoot":"","sources":["../../../../src/utils/textInputState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,UAAU,oBAAoB;IAC5B,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACzC,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5C,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IAChD,qBAAqB,IAAI,YAAY,GAAG,IAAI,CAAC;CAC9C;AAYD,eAAO,MAAM,cAAc,EACI,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EnrichedMarkdownTextProps } from '../types/MarkdownTextProps.web';
|
|
2
|
-
export declare const EnrichedMarkdownText: ({ markdown, markdownStyle, md4cFlags, onLinkPress, onLinkLongPress, onTaskListItemPress, allowTrailingMargin, containerStyle, selectable, dir, selectionColor, ...rest }: EnrichedMarkdownTextProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare const EnrichedMarkdownText: ({ markdown, markdownStyle, md4cFlags, onLinkPress, onLinkLongPress, onTaskListItemPress, enableTaskListItemToggle, allowTrailingMargin, containerStyle, selectable, dir, selectionColor, renderLinkDecoration, ...rest }: EnrichedMarkdownTextProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default EnrichedMarkdownText;
|
|
4
4
|
//# sourceMappingURL=EnrichedMarkdownText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrichedMarkdownText.d.ts","sourceRoot":"","sources":["../../../../src/web/EnrichedMarkdownText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAehF,eAAO,MAAM,oBAAoB,GAAI,
|
|
1
|
+
{"version":3,"file":"EnrichedMarkdownText.d.ts","sourceRoot":"","sources":["../../../../src/web/EnrichedMarkdownText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAehF,eAAO,MAAM,oBAAoB,GAAI,0NAelC,yBAAyB,mDA6I3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ASTNode } from './types';
|
|
2
2
|
import type { Md4cFlags } from '../types/MarkdownStyle';
|
|
3
|
-
export declare function parseMarkdown(markdown: string, { underline, latexMath, superscript, subscript, highlight, }?: Md4cFlags): Promise<ASTNode>;
|
|
3
|
+
export declare function parseMarkdown(markdown: string, { underline, latexMath, superscript, subscript, highlight, hardSoftBreaks, }?: Md4cFlags): Promise<ASTNode>;
|
|
4
4
|
//# sourceMappingURL=parseMarkdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/web/parseMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"parseMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/web/parseMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAkDxD,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,EACE,SAAiB,EACjB,SAAgB,EAChB,WAAmB,EACnB,SAAiB,EACjB,SAAiB,EACjB,cAAsB,GACvB,GAAE,SAAc,GAChB,OAAO,CAAC,OAAO,CAAC,CAoBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/InlineRenderers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InlineRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/InlineRenderers.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,UAAU,CAAC;AAmN3D,eAAO,MAAM,eAAe,EAAE,WAc7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/ListRenderers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,WAAW,EAAqB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ListRenderers.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/ListRenderers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,WAAW,EAAqB,MAAM,UAAU,CAAC;AAmH9E,eAAO,MAAM,aAAa,EAAE,WAI3B,CAAC"}
|
|
@@ -9,6 +9,7 @@ export interface RenderNodeProps {
|
|
|
9
9
|
callbacks: RendererCallbacks;
|
|
10
10
|
capabilities: RenderCapabilities;
|
|
11
11
|
parentType?: NodeType;
|
|
12
|
+
index?: number;
|
|
12
13
|
}
|
|
13
|
-
export declare function RenderNode({ node, style, styles, callbacks, capabilities, parentType, }: RenderNodeProps): ReactNode;
|
|
14
|
+
export declare function RenderNode({ node, style, styles, callbacks, capabilities, parentType, index, }: RenderNodeProps): ReactNode;
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAqBxC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,iBAAiB,CAAC;IAC7B,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/renderers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAqBxC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,iBAAiB,CAAC;IAC7B,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,SAAS,EACT,YAAY,EACZ,UAAU,EACV,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,CA8B7B"}
|
|
@@ -4,7 +4,7 @@ export declare function zeroTrailingMargins(style: MarkdownStyleInternal): Markd
|
|
|
4
4
|
type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
5
|
export declare function toHeadingLevel(level: string): HeadingLevel;
|
|
6
6
|
export declare function linkStyleForUrl(style: MarkdownStyleInternal, url: string): CSSProperties;
|
|
7
|
-
export declare function listItemStyle(isTask: boolean): CSSProperties | undefined;
|
|
7
|
+
export declare function listItemStyle(style: MarkdownStyleInternal, isTask: boolean, isFirstChild: boolean): CSSProperties | undefined;
|
|
8
8
|
export declare function checkedTaskTextStyle(style: MarkdownStyleInternal): CSSProperties;
|
|
9
9
|
export declare function tableBodyRowStyle(style: MarkdownStyleInternal, rowIndex: number): CSSProperties;
|
|
10
10
|
export declare const parseErrorFallbackStyle: CSSProperties;
|
|
@@ -42,6 +42,7 @@ export interface Styles {
|
|
|
42
42
|
tableHeaderCell: Record<ColumnAlign, CSSProperties>;
|
|
43
43
|
tableCell: Record<ColumnAlign, CSSProperties>;
|
|
44
44
|
taskCheckbox: CSSProperties;
|
|
45
|
+
taskCheckboxDisabled: CSSProperties;
|
|
45
46
|
}
|
|
46
47
|
type ColumnAlign = 'left' | 'center' | 'right' | 'default';
|
|
47
48
|
export declare function buildStyles(style: MarkdownStyleInternal): Styles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/web/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAwCxC,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,qBAAqB,GAC3B,qBAAqB,CAkBvB;AAED,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5D,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAG1D;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/web/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAwCxC,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,qBAAqB,GAC3B,qBAAqB,CAkBvB;AAED,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5D,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAG1D;AAiPD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,qBAAqB,EAC5B,GAAG,EAAE,MAAM,GACV,aAAa,CA2Cf;AAgFD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,OAAO,EACf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