react-native-enriched-markdown 0.1.0 → 0.2.0
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/LICENSE +20 -0
- package/README.md +551 -0
- package/ReactNativeEnrichedMarkdown.podspec +27 -0
- package/android/build.gradle +101 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerDelegate.java +54 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerInterface.java +26 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/ComponentDescriptors.h +24 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/EventEmitters.cpp +33 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/EventEmitters.h +31 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.cpp +82 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.h +1388 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/ShadowNodes.cpp +17 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/ShadowNodes.h +32 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/States.h +20 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/baseline-prof.txt +65 -0
- package/android/src/main/cpp/jni-adapter.cpp +220 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownText.kt +270 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextLayoutManager.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextManager.kt +173 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextPackage.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/MeasurementStore.kt +385 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/accessibility/MarkdownAccessibilityHelper.kt +279 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/events/LinkLongPressEvent.kt +23 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/events/LinkPressEvent.kt +23 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/parser/MarkdownASTNode.kt +31 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/parser/Parser.kt +62 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/BlockStyleContext.kt +166 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/BlockquoteRenderer.kt +84 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/CodeBlockRenderer.kt +104 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/CodeRenderer.kt +36 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/DocumentRenderer.kt +16 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/EmphasisRenderer.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/HeadingRenderer.kt +70 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ImageRenderer.kt +68 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/LineBreakRenderer.kt +16 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/LinkRenderer.kt +29 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListContextManager.kt +105 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListItemRenderer.kt +59 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ListRenderer.kt +76 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/NodeRenderer.kt +103 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ParagraphRenderer.kt +80 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/Renderer.kt +109 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/SpanStyleCache.kt +86 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/StrikethroughRenderer.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/StrongRenderer.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/TextRenderer.kt +30 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/ThematicBreakRenderer.kt +45 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/UnderlineRenderer.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/BaseListSpan.kt +136 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/BlockquoteSpan.kt +135 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeBackgroundSpan.kt +180 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeBlockSpan.kt +196 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/CodeSpan.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/EmphasisSpan.kt +34 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/HeadingSpan.kt +38 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/ImageSpan.kt +321 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/LineHeightSpan.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/LinkSpan.kt +51 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/MarginBottomSpan.kt +76 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/OrderedListSpan.kt +87 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/StrikethroughSpan.kt +12 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/StrongSpan.kt +37 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/TextSpan.kt +26 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/ThematicBreakSpan.kt +69 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/spans/UnorderedListSpan.kt +69 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/BaseBlockStyle.kt +11 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/BlockquoteStyle.kt +51 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/CodeBlockStyle.kt +54 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/CodeStyle.kt +21 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/EmphasisStyle.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/HeadingStyle.kt +33 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/ImageStyle.kt +23 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/InlineImageStyle.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/LinkStyle.kt +19 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/ListStyle.kt +57 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/ParagraphStyle.kt +33 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/StrikethroughStyle.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/StrongStyle.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/StyleConfig.kt +211 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/StyleParser.kt +92 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/TextAlignment.kt +32 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/ThematicBreakStyle.kt +23 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/styles/UnderlineStyle.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/AsyncDrawable.kt +91 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/HTMLGenerator.kt +827 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/LinkLongPressMovementMethod.kt +121 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/MarkdownExtractor.kt +375 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/SelectionActionMode.kt +139 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/Utils.kt +183 -0
- package/android/src/main/jni/CMakeLists.txt +70 -0
- package/android/src/main/jni/EnrichedMarkdownTextSpec.cpp +21 -0
- package/android/src/main/jni/EnrichedMarkdownTextSpec.h +25 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextComponentDescriptor.h +29 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextMeasurementManager.cpp +45 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextMeasurementManager.h +21 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextShadowNode.cpp +20 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/MarkdownTextShadowNode.h +37 -0
- package/android/src/main/jni/react/renderer/components/EnrichedMarkdownTextSpec/conversions.h +22 -0
- package/cpp/md4c/md4c.c +6492 -0
- package/cpp/md4c/md4c.h +402 -0
- package/cpp/parser/MD4CParser.cpp +327 -0
- package/cpp/parser/MD4CParser.hpp +27 -0
- package/cpp/parser/MarkdownASTNode.hpp +51 -0
- package/ios/EnrichedMarkdownText.h +18 -0
- package/ios/EnrichedMarkdownText.mm +1401 -0
- package/ios/attachments/EnrichedMarkdownImageAttachment.h +23 -0
- package/ios/attachments/EnrichedMarkdownImageAttachment.m +185 -0
- package/ios/attachments/ThematicBreakAttachment.h +15 -0
- package/ios/attachments/ThematicBreakAttachment.m +33 -0
- package/ios/generated/EnrichedMarkdownTextSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/EnrichedMarkdownTextSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/EnrichedMarkdownTextSpec/EventEmitters.cpp +33 -0
- package/ios/generated/EnrichedMarkdownTextSpec/EventEmitters.h +31 -0
- package/ios/generated/EnrichedMarkdownTextSpec/Props.cpp +82 -0
- package/ios/generated/EnrichedMarkdownTextSpec/Props.h +1388 -0
- package/ios/generated/EnrichedMarkdownTextSpec/RCTComponentViewHelpers.h +20 -0
- package/ios/generated/EnrichedMarkdownTextSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/EnrichedMarkdownTextSpec/ShadowNodes.h +32 -0
- package/ios/generated/EnrichedMarkdownTextSpec/States.cpp +16 -0
- package/ios/generated/EnrichedMarkdownTextSpec/States.h +20 -0
- package/ios/internals/EnrichedMarkdownTextComponentDescriptor.h +19 -0
- package/ios/internals/EnrichedMarkdownTextShadowNode.h +43 -0
- package/ios/internals/EnrichedMarkdownTextShadowNode.mm +85 -0
- package/ios/internals/EnrichedMarkdownTextState.h +24 -0
- package/ios/parser/MarkdownASTNode.h +35 -0
- package/ios/parser/MarkdownASTNode.m +32 -0
- package/ios/parser/MarkdownParser.h +17 -0
- package/ios/parser/MarkdownParser.mm +42 -0
- package/ios/parser/MarkdownParserBridge.mm +120 -0
- package/ios/renderer/AttributedRenderer.h +11 -0
- package/ios/renderer/AttributedRenderer.m +152 -0
- package/ios/renderer/BlockquoteRenderer.h +7 -0
- package/ios/renderer/BlockquoteRenderer.m +160 -0
- package/ios/renderer/CodeBlockRenderer.h +10 -0
- package/ios/renderer/CodeBlockRenderer.m +90 -0
- package/ios/renderer/CodeRenderer.h +10 -0
- package/ios/renderer/CodeRenderer.m +60 -0
- package/ios/renderer/EmphasisRenderer.h +6 -0
- package/ios/renderer/EmphasisRenderer.m +96 -0
- package/ios/renderer/HeadingRenderer.h +7 -0
- package/ios/renderer/HeadingRenderer.m +105 -0
- package/ios/renderer/ImageRenderer.h +12 -0
- package/ios/renderer/ImageRenderer.m +83 -0
- package/ios/renderer/LinkRenderer.h +7 -0
- package/ios/renderer/LinkRenderer.m +69 -0
- package/ios/renderer/ListItemRenderer.h +16 -0
- package/ios/renderer/ListItemRenderer.m +103 -0
- package/ios/renderer/ListRenderer.h +13 -0
- package/ios/renderer/ListRenderer.m +70 -0
- package/ios/renderer/NodeRenderer.h +8 -0
- package/ios/renderer/ParagraphRenderer.h +7 -0
- package/ios/renderer/ParagraphRenderer.m +80 -0
- package/ios/renderer/RenderContext.h +105 -0
- package/ios/renderer/RenderContext.m +312 -0
- package/ios/renderer/RendererFactory.h +12 -0
- package/ios/renderer/RendererFactory.m +116 -0
- package/ios/renderer/StrikethroughRenderer.h +6 -0
- package/ios/renderer/StrikethroughRenderer.m +40 -0
- package/ios/renderer/StrongRenderer.h +6 -0
- package/ios/renderer/StrongRenderer.m +83 -0
- package/ios/renderer/TextRenderer.h +6 -0
- package/ios/renderer/TextRenderer.m +16 -0
- package/ios/renderer/ThematicBreakRenderer.h +5 -0
- package/ios/renderer/ThematicBreakRenderer.m +53 -0
- package/ios/renderer/UnderlineRenderer.h +6 -0
- package/ios/renderer/UnderlineRenderer.m +39 -0
- package/ios/styles/StyleConfig.h +274 -0
- package/ios/styles/StyleConfig.mm +1806 -0
- package/ios/utils/AccessibilityInfo.h +35 -0
- package/ios/utils/AccessibilityInfo.m +24 -0
- package/ios/utils/BlockquoteBorder.h +20 -0
- package/ios/utils/BlockquoteBorder.m +92 -0
- package/ios/utils/CodeBackground.h +19 -0
- package/ios/utils/CodeBackground.m +191 -0
- package/ios/utils/CodeBlockBackground.h +17 -0
- package/ios/utils/CodeBlockBackground.m +82 -0
- package/ios/utils/EditMenuUtils.h +22 -0
- package/ios/utils/EditMenuUtils.m +118 -0
- package/ios/utils/FontUtils.h +25 -0
- package/ios/utils/FontUtils.m +27 -0
- package/ios/utils/HTMLGenerator.h +20 -0
- package/ios/utils/HTMLGenerator.m +793 -0
- package/ios/utils/LastElementUtils.h +53 -0
- package/ios/utils/ListMarkerDrawer.h +15 -0
- package/ios/utils/ListMarkerDrawer.m +127 -0
- package/ios/utils/MarkdownAccessibilityElementBuilder.h +45 -0
- package/ios/utils/MarkdownAccessibilityElementBuilder.m +323 -0
- package/ios/utils/MarkdownExtractor.h +17 -0
- package/ios/utils/MarkdownExtractor.m +308 -0
- package/ios/utils/ParagraphStyleUtils.h +21 -0
- package/ios/utils/ParagraphStyleUtils.m +111 -0
- package/ios/utils/PasteboardUtils.h +36 -0
- package/ios/utils/PasteboardUtils.m +134 -0
- package/ios/utils/RTFExportUtils.h +24 -0
- package/ios/utils/RTFExportUtils.m +297 -0
- package/ios/utils/RuntimeKeys.h +38 -0
- package/ios/utils/RuntimeKeys.m +11 -0
- package/ios/utils/TextViewLayoutManager.h +14 -0
- package/ios/utils/TextViewLayoutManager.mm +113 -0
- package/lib/module/EnrichedMarkdownText.js +65 -0
- package/lib/module/EnrichedMarkdownText.js.map +1 -0
- package/lib/module/EnrichedMarkdownTextNativeComponent.ts +210 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/normalizeMarkdownStyle.js +384 -0
- package/lib/module/normalizeMarkdownStyle.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/EnrichedMarkdownText.d.ts +183 -0
- package/lib/typescript/src/EnrichedMarkdownText.d.ts.map +1 -0
- package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts +185 -0
- package/lib/typescript/src/EnrichedMarkdownTextNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/normalizeMarkdownStyle.d.ts +6 -0
- package/lib/typescript/src/normalizeMarkdownStyle.d.ts.map +1 -0
- package/package.json +186 -1
- package/react-native.config.js +13 -0
- package/src/EnrichedMarkdownText.tsx +280 -0
- package/src/EnrichedMarkdownTextNativeComponent.ts +210 -0
- package/src/index.tsx +10 -0
- package/src/normalizeMarkdownStyle.ts +423 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { type NativeProps, type LinkPressEvent, type LinkLongPressEvent } from './EnrichedMarkdownTextNativeComponent';
|
|
2
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
type TextAlign = 'auto' | 'left' | 'right' | 'center' | 'justify';
|
|
4
|
+
interface BaseBlockStyle {
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
fontFamily?: string;
|
|
7
|
+
fontWeight?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
marginTop?: number;
|
|
10
|
+
marginBottom?: number;
|
|
11
|
+
lineHeight?: number;
|
|
12
|
+
}
|
|
13
|
+
interface ParagraphStyle extends BaseBlockStyle {
|
|
14
|
+
textAlign?: TextAlign;
|
|
15
|
+
}
|
|
16
|
+
interface HeadingStyle extends BaseBlockStyle {
|
|
17
|
+
textAlign?: TextAlign;
|
|
18
|
+
}
|
|
19
|
+
interface BlockquoteStyle extends BaseBlockStyle {
|
|
20
|
+
borderColor?: string;
|
|
21
|
+
borderWidth?: number;
|
|
22
|
+
gapWidth?: number;
|
|
23
|
+
backgroundColor?: string;
|
|
24
|
+
}
|
|
25
|
+
interface ListStyle extends BaseBlockStyle {
|
|
26
|
+
bulletColor?: string;
|
|
27
|
+
bulletSize?: number;
|
|
28
|
+
markerColor?: string;
|
|
29
|
+
markerFontWeight?: string;
|
|
30
|
+
gapWidth?: number;
|
|
31
|
+
marginLeft?: number;
|
|
32
|
+
}
|
|
33
|
+
interface CodeBlockStyle extends BaseBlockStyle {
|
|
34
|
+
backgroundColor?: string;
|
|
35
|
+
borderColor?: string;
|
|
36
|
+
borderRadius?: number;
|
|
37
|
+
borderWidth?: number;
|
|
38
|
+
padding?: number;
|
|
39
|
+
}
|
|
40
|
+
interface LinkStyle {
|
|
41
|
+
color?: string;
|
|
42
|
+
underline?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface StrongStyle {
|
|
45
|
+
color?: string;
|
|
46
|
+
}
|
|
47
|
+
interface EmphasisStyle {
|
|
48
|
+
color?: string;
|
|
49
|
+
}
|
|
50
|
+
interface StrikethroughStyle {
|
|
51
|
+
/**
|
|
52
|
+
* Color of the strikethrough line.
|
|
53
|
+
* @platform iOS
|
|
54
|
+
*/
|
|
55
|
+
color?: string;
|
|
56
|
+
}
|
|
57
|
+
interface UnderlineStyle {
|
|
58
|
+
/**
|
|
59
|
+
* Color of the underline.
|
|
60
|
+
* @platform iOS
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
}
|
|
64
|
+
interface CodeStyle {
|
|
65
|
+
color?: string;
|
|
66
|
+
backgroundColor?: string;
|
|
67
|
+
borderColor?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ImageStyle {
|
|
70
|
+
height?: number;
|
|
71
|
+
borderRadius?: number;
|
|
72
|
+
marginTop?: number;
|
|
73
|
+
marginBottom?: number;
|
|
74
|
+
}
|
|
75
|
+
interface InlineImageStyle {
|
|
76
|
+
size?: number;
|
|
77
|
+
}
|
|
78
|
+
interface ThematicBreakStyle {
|
|
79
|
+
color?: string;
|
|
80
|
+
height?: number;
|
|
81
|
+
marginTop?: number;
|
|
82
|
+
marginBottom?: number;
|
|
83
|
+
}
|
|
84
|
+
export interface MarkdownStyle {
|
|
85
|
+
paragraph?: ParagraphStyle;
|
|
86
|
+
h1?: HeadingStyle;
|
|
87
|
+
h2?: HeadingStyle;
|
|
88
|
+
h3?: HeadingStyle;
|
|
89
|
+
h4?: HeadingStyle;
|
|
90
|
+
h5?: HeadingStyle;
|
|
91
|
+
h6?: HeadingStyle;
|
|
92
|
+
blockquote?: BlockquoteStyle;
|
|
93
|
+
list?: ListStyle;
|
|
94
|
+
codeBlock?: CodeBlockStyle;
|
|
95
|
+
link?: LinkStyle;
|
|
96
|
+
strong?: StrongStyle;
|
|
97
|
+
em?: EmphasisStyle;
|
|
98
|
+
strikethrough?: StrikethroughStyle;
|
|
99
|
+
underline?: UnderlineStyle;
|
|
100
|
+
code?: CodeStyle;
|
|
101
|
+
image?: ImageStyle;
|
|
102
|
+
inlineImage?: InlineImageStyle;
|
|
103
|
+
thematicBreak?: ThematicBreakStyle;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* MD4C parser flags configuration.
|
|
107
|
+
* Controls how the markdown parser interprets certain syntax.
|
|
108
|
+
*/
|
|
109
|
+
export interface Md4cFlags {
|
|
110
|
+
/**
|
|
111
|
+
* Enable underline syntax support (__text__).
|
|
112
|
+
* When enabled, underscores are treated as underline markers.
|
|
113
|
+
* When disabled, underscores are treated as emphasis markers (same as asterisks).
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
underline?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface EnrichedMarkdownTextProps extends Omit<NativeProps, 'markdownStyle' | 'style' | 'onLinkPress' | 'onLinkLongPress' | 'md4cFlags' | 'enableLinkPreview'> {
|
|
119
|
+
/**
|
|
120
|
+
* Style configuration for markdown elements
|
|
121
|
+
*/
|
|
122
|
+
markdownStyle?: MarkdownStyle;
|
|
123
|
+
/**
|
|
124
|
+
* Style for the container view.
|
|
125
|
+
*/
|
|
126
|
+
containerStyle?: ViewStyle | TextStyle;
|
|
127
|
+
/**
|
|
128
|
+
* Callback fired when a link is pressed.
|
|
129
|
+
* Receives the link URL directly.
|
|
130
|
+
*/
|
|
131
|
+
onLinkPress?: (event: LinkPressEvent) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Callback fired when a link is long pressed.
|
|
134
|
+
* Receives the link URL directly.
|
|
135
|
+
* - iOS: When provided, automatically disables the system link preview (unless `enableLinkPreview` is explicitly set to `true`).
|
|
136
|
+
* - Android: Handles long press gestures on links.
|
|
137
|
+
*/
|
|
138
|
+
onLinkLongPress?: (event: LinkLongPressEvent) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Controls whether the system link preview is shown on long press (iOS only).
|
|
141
|
+
*
|
|
142
|
+
* When `true`, long-pressing a link shows the native iOS link preview.
|
|
143
|
+
* When `false`, the system preview is suppressed.
|
|
144
|
+
*
|
|
145
|
+
* Defaults to `true`, but automatically becomes `false` when `onLinkLongPress` is provided.
|
|
146
|
+
* Set explicitly to override the automatic behavior.
|
|
147
|
+
*
|
|
148
|
+
* Android: No-op.
|
|
149
|
+
*
|
|
150
|
+
* @default true
|
|
151
|
+
* @platform ios
|
|
152
|
+
*/
|
|
153
|
+
enableLinkPreview?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* MD4C parser flags configuration.
|
|
156
|
+
* Controls how the markdown parser interprets certain syntax.
|
|
157
|
+
*/
|
|
158
|
+
md4cFlags?: Md4cFlags;
|
|
159
|
+
/**
|
|
160
|
+
* Specifies whether fonts should scale to respect Text Size accessibility settings.
|
|
161
|
+
* When false, text will not scale with the user's accessibility settings.
|
|
162
|
+
* @default true
|
|
163
|
+
*/
|
|
164
|
+
allowFontScaling?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Specifies the largest possible scale a font can reach when allowFontScaling is enabled.
|
|
167
|
+
* Possible values:
|
|
168
|
+
* - undefined/null (default): no limit
|
|
169
|
+
* - 0: no limit
|
|
170
|
+
* - >= 1: sets the maxFontSizeMultiplier of this node to this value
|
|
171
|
+
* @default undefined
|
|
172
|
+
*/
|
|
173
|
+
maxFontSizeMultiplier?: number;
|
|
174
|
+
/**
|
|
175
|
+
* When false (default), removes trailing margin from the last element to eliminate bottom spacing.
|
|
176
|
+
* When true, keeps the trailing margin from the last element's marginBottom style.
|
|
177
|
+
* @default false
|
|
178
|
+
*/
|
|
179
|
+
allowTrailingMargin?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export declare const EnrichedMarkdownText: ({ markdown, markdownStyle, containerStyle, onLinkPress, onLinkLongPress, enableLinkPreview, selectable, md4cFlags, allowFontScaling, maxFontSizeMultiplier, allowTrailingMargin, ...rest }: EnrichedMarkdownTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
182
|
+
export default EnrichedMarkdownText;
|
|
183
|
+
//# sourceMappingURL=EnrichedMarkdownText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnrichedMarkdownText.d.ts","sourceRoot":"","sources":["../../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M,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAMD,eAAO,MAAM,oBAAoB,GAAI,4LAalC,yBAAyB,4CA6C3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { type ViewProps, type CodegenTypes, type ColorValue } from 'react-native';
|
|
2
|
+
interface BaseBlockStyleInternal {
|
|
3
|
+
fontSize: CodegenTypes.Float;
|
|
4
|
+
fontFamily: string;
|
|
5
|
+
fontWeight: string;
|
|
6
|
+
color: ColorValue;
|
|
7
|
+
marginTop: CodegenTypes.Float;
|
|
8
|
+
marginBottom: CodegenTypes.Float;
|
|
9
|
+
lineHeight: CodegenTypes.Float;
|
|
10
|
+
}
|
|
11
|
+
interface ParagraphStyleInternal extends BaseBlockStyleInternal {
|
|
12
|
+
textAlign: string;
|
|
13
|
+
}
|
|
14
|
+
interface HeadingStyleInternal extends BaseBlockStyleInternal {
|
|
15
|
+
textAlign: string;
|
|
16
|
+
}
|
|
17
|
+
interface BlockquoteStyleInternal extends BaseBlockStyleInternal {
|
|
18
|
+
borderColor: ColorValue;
|
|
19
|
+
borderWidth: CodegenTypes.Float;
|
|
20
|
+
gapWidth: CodegenTypes.Float;
|
|
21
|
+
backgroundColor: ColorValue;
|
|
22
|
+
}
|
|
23
|
+
interface ListStyleInternal extends BaseBlockStyleInternal {
|
|
24
|
+
bulletColor: ColorValue;
|
|
25
|
+
bulletSize: CodegenTypes.Float;
|
|
26
|
+
markerColor: ColorValue;
|
|
27
|
+
markerFontWeight: string;
|
|
28
|
+
gapWidth: CodegenTypes.Float;
|
|
29
|
+
marginLeft: CodegenTypes.Float;
|
|
30
|
+
}
|
|
31
|
+
interface CodeBlockStyleInternal extends BaseBlockStyleInternal {
|
|
32
|
+
backgroundColor: ColorValue;
|
|
33
|
+
borderColor: ColorValue;
|
|
34
|
+
borderRadius: CodegenTypes.Float;
|
|
35
|
+
borderWidth: CodegenTypes.Float;
|
|
36
|
+
padding: CodegenTypes.Float;
|
|
37
|
+
}
|
|
38
|
+
interface LinkStyleInternal {
|
|
39
|
+
color: ColorValue;
|
|
40
|
+
underline: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface StrongStyleInternal {
|
|
43
|
+
color?: ColorValue;
|
|
44
|
+
}
|
|
45
|
+
interface EmphasisStyleInternal {
|
|
46
|
+
color?: ColorValue;
|
|
47
|
+
}
|
|
48
|
+
interface StrikethroughStyleInternal {
|
|
49
|
+
color: ColorValue;
|
|
50
|
+
}
|
|
51
|
+
interface UnderlineStyleInternal {
|
|
52
|
+
color: ColorValue;
|
|
53
|
+
}
|
|
54
|
+
interface CodeStyleInternal {
|
|
55
|
+
color: ColorValue;
|
|
56
|
+
backgroundColor: ColorValue;
|
|
57
|
+
borderColor: ColorValue;
|
|
58
|
+
}
|
|
59
|
+
interface ImageStyleInternal {
|
|
60
|
+
height: CodegenTypes.Float;
|
|
61
|
+
borderRadius: CodegenTypes.Float;
|
|
62
|
+
marginTop: CodegenTypes.Float;
|
|
63
|
+
marginBottom: CodegenTypes.Float;
|
|
64
|
+
}
|
|
65
|
+
interface InlineImageStyleInternal {
|
|
66
|
+
size: CodegenTypes.Float;
|
|
67
|
+
}
|
|
68
|
+
interface ThematicBreakStyleInternal {
|
|
69
|
+
color: ColorValue;
|
|
70
|
+
height: CodegenTypes.Float;
|
|
71
|
+
marginTop: CodegenTypes.Float;
|
|
72
|
+
marginBottom: CodegenTypes.Float;
|
|
73
|
+
}
|
|
74
|
+
export interface MarkdownStyleInternal {
|
|
75
|
+
paragraph: ParagraphStyleInternal;
|
|
76
|
+
h1: HeadingStyleInternal;
|
|
77
|
+
h2: HeadingStyleInternal;
|
|
78
|
+
h3: HeadingStyleInternal;
|
|
79
|
+
h4: HeadingStyleInternal;
|
|
80
|
+
h5: HeadingStyleInternal;
|
|
81
|
+
h6: HeadingStyleInternal;
|
|
82
|
+
blockquote: BlockquoteStyleInternal;
|
|
83
|
+
list: ListStyleInternal;
|
|
84
|
+
codeBlock: CodeBlockStyleInternal;
|
|
85
|
+
link: LinkStyleInternal;
|
|
86
|
+
strong: StrongStyleInternal;
|
|
87
|
+
em: EmphasisStyleInternal;
|
|
88
|
+
strikethrough: StrikethroughStyleInternal;
|
|
89
|
+
underline: UnderlineStyleInternal;
|
|
90
|
+
code: CodeStyleInternal;
|
|
91
|
+
image: ImageStyleInternal;
|
|
92
|
+
inlineImage: InlineImageStyleInternal;
|
|
93
|
+
thematicBreak: ThematicBreakStyleInternal;
|
|
94
|
+
}
|
|
95
|
+
export interface LinkPressEvent {
|
|
96
|
+
url: string;
|
|
97
|
+
}
|
|
98
|
+
export interface LinkLongPressEvent {
|
|
99
|
+
url: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* MD4C parser flags configuration.
|
|
103
|
+
* Controls how the markdown parser interprets certain syntax.
|
|
104
|
+
*/
|
|
105
|
+
export interface Md4cFlagsInternal {
|
|
106
|
+
/**
|
|
107
|
+
* Enable underline syntax support (__text__).
|
|
108
|
+
* When enabled, underscores are treated as underline markers.
|
|
109
|
+
* When disabled, underscores are treated as emphasis markers (same as asterisks).
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
underline: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface NativeProps extends ViewProps {
|
|
115
|
+
/**
|
|
116
|
+
* Markdown content to render.
|
|
117
|
+
*/
|
|
118
|
+
markdown: string;
|
|
119
|
+
/**
|
|
120
|
+
* Internal style configuration for markdown elements.
|
|
121
|
+
* Always provided with complete defaults via normalizeMarkdownStyle.
|
|
122
|
+
* Block styles (paragraph, headings) contain fontSize, fontFamily, fontWeight, and color.
|
|
123
|
+
*/
|
|
124
|
+
markdownStyle: MarkdownStyleInternal;
|
|
125
|
+
/**
|
|
126
|
+
* Callback fired when a link is pressed.
|
|
127
|
+
* Receives the URL that was tapped.
|
|
128
|
+
*/
|
|
129
|
+
onLinkPress?: CodegenTypes.BubblingEventHandler<LinkPressEvent>;
|
|
130
|
+
/**
|
|
131
|
+
* Callback fired when a link is long pressed.
|
|
132
|
+
* Receives the URL that was long pressed.
|
|
133
|
+
* - iOS: When provided, overrides the system link preview behavior.
|
|
134
|
+
* - Android: Handles long press gestures on links.
|
|
135
|
+
*/
|
|
136
|
+
onLinkLongPress?: CodegenTypes.BubblingEventHandler<LinkLongPressEvent>;
|
|
137
|
+
/**
|
|
138
|
+
* Controls whether the system link preview is shown on long press (iOS only).
|
|
139
|
+
*
|
|
140
|
+
* When `true` (default), long-pressing a link shows the native iOS link preview.
|
|
141
|
+
* When `false`, the system preview is suppressed.
|
|
142
|
+
*
|
|
143
|
+
* Automatically set to `false` when `onLinkLongPress` is provided (unless explicitly overridden).
|
|
144
|
+
*
|
|
145
|
+
* Android: No-op (Android doesn't have a system link preview).
|
|
146
|
+
*
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
enableLinkPreview?: CodegenTypes.WithDefault<boolean, true>;
|
|
150
|
+
/**
|
|
151
|
+
* - iOS: Controls text selection and link previews on long press.
|
|
152
|
+
* - Android: Controls text selection.
|
|
153
|
+
* @default true
|
|
154
|
+
*/
|
|
155
|
+
selectable?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* MD4C parser flags configuration.
|
|
158
|
+
* Controls how the markdown parser interprets certain syntax.
|
|
159
|
+
*/
|
|
160
|
+
md4cFlags: Md4cFlagsInternal;
|
|
161
|
+
/**
|
|
162
|
+
* Specifies whether fonts should scale to respect Text Size accessibility settings.
|
|
163
|
+
* When false, text will not scale with the user's accessibility settings.
|
|
164
|
+
* @default true
|
|
165
|
+
*/
|
|
166
|
+
allowFontScaling?: CodegenTypes.WithDefault<boolean, true>;
|
|
167
|
+
/**
|
|
168
|
+
* Specifies the largest possible scale a font can reach when allowFontScaling is enabled.
|
|
169
|
+
* Possible values:
|
|
170
|
+
* - undefined/null (default): inherit from parent or global default (no limit)
|
|
171
|
+
* - 0: no limit, ignore parent/global default
|
|
172
|
+
* - >= 1: sets the maxFontSizeMultiplier of this node to this value
|
|
173
|
+
* @default undefined
|
|
174
|
+
*/
|
|
175
|
+
maxFontSizeMultiplier?: CodegenTypes.Float;
|
|
176
|
+
/**
|
|
177
|
+
* When false (default), removes trailing margin from the last element to eliminate bottom spacing.
|
|
178
|
+
* When true, keeps the trailing margin from the last element's marginBottom style.
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
allowTrailingMargin?: CodegenTypes.WithDefault<boolean, false>;
|
|
182
|
+
}
|
|
183
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
184
|
+
export default _default;
|
|
185
|
+
//# sourceMappingURL=EnrichedMarkdownTextNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnrichedMarkdownTextNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/EnrichedMarkdownTextNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAGtB,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC;IAC9B,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC;IACjC,UAAU,EAAE,YAAY,CAAC,KAAK,CAAC;CAChC;AAED,UAAU,sBAAuB,SAAQ,sBAAsB;IAC7D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,oBAAqB,SAAQ,sBAAsB;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,uBAAwB,SAAQ,sBAAsB;IAC9D,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EA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EAAE,qBAAqB,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAChE;;;;;OAKG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IACxE;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5D;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,iBAAiB,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC3D;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC3C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;CAChE;;AAED,wBAA2E"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as EnrichedMarkdownText } from './EnrichedMarkdownText';
|
|
2
|
+
export type { EnrichedMarkdownTextProps, MarkdownStyle, Md4cFlags, } from './EnrichedMarkdownText';
|
|
3
|
+
export type { LinkPressEvent, LinkLongPressEvent, } from './EnrichedMarkdownTextNativeComponent';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EACV,yBAAyB,EACzB,aAAa,EACb,SAAS,GACV,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,cAAc,EACd,kBAAkB,GACnB,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ColorValue } from 'react-native';
|
|
2
|
+
import type { MarkdownStyle } from './EnrichedMarkdownText';
|
|
3
|
+
import type { MarkdownStyleInternal } from './EnrichedMarkdownTextNativeComponent';
|
|
4
|
+
export declare const normalizeColor: (color: string | undefined) => ColorValue | undefined;
|
|
5
|
+
export declare const normalizeMarkdownStyle: (style: MarkdownStyle) => MarkdownStyleInternal;
|
|
6
|
+
//# sourceMappingURL=normalizeMarkdownStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeMarkdownStyle.d.ts","sourceRoot":"","sources":["../../../src/normalizeMarkdownStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAEnF,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,GAAG,SAAS,KACxB,UAAU,GAAG,SAMf,CAAC;AAsMF,eAAO,MAAM,sBAAsB,GACjC,OAAO,aAAa,KACnB,qBAkNF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,189 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-enriched-markdown",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Markdown Text component for React Native",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!**/__tests__",
|
|
30
|
+
"!**/__fixtures__",
|
|
31
|
+
"!**/__mocks__",
|
|
32
|
+
"!**/.*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"example": "yarn workspace react-native-enriched-markdown-example",
|
|
36
|
+
"android:build:release": "cd example && npx react-native build-android --mode=release",
|
|
37
|
+
"android:test:release": "cd example && yarn android --mode release",
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"typecheck": "tsc",
|
|
40
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
41
|
+
"lint-clang:ios": "find ios/ \\( -iname \"*.h\" -o -iname \"*.m\" -o -iname \"*.mm\" \\) | grep -v -e Pods -e build | xargs npx clang-format -i -n --Werror",
|
|
42
|
+
"lint-clang:ios:fix": "find ios/ \\( -iname \"*.h\" -o -iname \"*.m\" -o -iname \"*.mm\" \\) | grep -v -e Pods -e build | xargs npx clang-format -i",
|
|
43
|
+
"lint-clang:android": "find android/ \\( -iname \"*.h\" -o -iname \"*.cpp\" \\) | grep -v -e build | xargs npx clang-format -i -n --Werror",
|
|
44
|
+
"lint-clang:android:fix": "find android/ \\( -iname \"*.h\" -o -iname \"*.cpp\" \\) | grep -v -e build | xargs npx clang-format -i",
|
|
45
|
+
"lint-clang": "yarn lint-clang:ios && yarn lint-clang:android",
|
|
46
|
+
"lint-clang:fix": "yarn lint-clang:ios:fix && yarn lint-clang:android:fix",
|
|
47
|
+
"lint-kotlin": "cd example/android && ./gradlew :react-native-enriched-markdown:ktlintCheck",
|
|
48
|
+
"lint-kotlin:fix": "cd example/android && ./gradlew :react-native-enriched-markdown:ktlintFormat",
|
|
49
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
50
|
+
"prepare": "bob build",
|
|
51
|
+
"release": "release-it --only-version"
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"react-native",
|
|
55
|
+
"ios",
|
|
56
|
+
"android",
|
|
57
|
+
"markdown"
|
|
58
|
+
],
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "git+https://github.com/software-mansion-labs/react-native-enriched-markdown.git"
|
|
62
|
+
},
|
|
63
|
+
"author": "Gregory Moskaliuk <mosckalyuck@gmail.com> (https://github.com/hryhoriiK97)",
|
|
64
|
+
"license": "MIT",
|
|
65
|
+
"bugs": {
|
|
66
|
+
"url": "https://github.com/software-mansion-labs/react-native-enriched-markdown/issues"
|
|
67
|
+
},
|
|
68
|
+
"homepage": "https://github.com/software-mansion-labs/react-native-enriched-markdown#readme",
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"registry": "https://registry.npmjs.org/"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
74
|
+
"@eslint/compat": "^1.3.2",
|
|
75
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
76
|
+
"@eslint/js": "^9.35.0",
|
|
77
|
+
"@evilmartians/lefthook": "^1.12.3",
|
|
78
|
+
"@react-native-community/cli": "20.0.1",
|
|
79
|
+
"@react-native/babel-preset": "0.81.1",
|
|
80
|
+
"@react-native/eslint-config": "^0.81.1",
|
|
81
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
82
|
+
"@types/jest": "^29.5.14",
|
|
83
|
+
"@types/react": "^19.1.0",
|
|
84
|
+
"clang-format": "^1.8.0",
|
|
85
|
+
"commitlint": "^19.8.1",
|
|
86
|
+
"del-cli": "^6.0.0",
|
|
87
|
+
"eslint": "^9.35.0",
|
|
88
|
+
"eslint-config-prettier": "^10.1.8",
|
|
89
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
90
|
+
"jest": "^29.7.0",
|
|
91
|
+
"prettier": "^3.6.2",
|
|
92
|
+
"react": "19.1.0",
|
|
93
|
+
"react-native": "0.81.1",
|
|
94
|
+
"react-native-builder-bob": "^0.40.13",
|
|
95
|
+
"release-it": "^19.0.4",
|
|
96
|
+
"turbo": "^2.5.6",
|
|
97
|
+
"typescript": "^5.9.2"
|
|
98
|
+
},
|
|
99
|
+
"peerDependencies": {
|
|
100
|
+
"react": "*",
|
|
101
|
+
"react-native": "*"
|
|
102
|
+
},
|
|
103
|
+
"workspaces": [
|
|
104
|
+
"example"
|
|
105
|
+
],
|
|
106
|
+
"packageManager": "yarn@3.6.1",
|
|
107
|
+
"jest": {
|
|
108
|
+
"preset": "react-native",
|
|
109
|
+
"modulePathIgnorePatterns": [
|
|
110
|
+
"<rootDir>/example/node_modules",
|
|
111
|
+
"<rootDir>/lib/"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"commitlint": {
|
|
115
|
+
"extends": [
|
|
116
|
+
"@commitlint/config-conventional"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"release-it": {
|
|
120
|
+
"git": {
|
|
121
|
+
"commitMessage": "chore: release ${version}",
|
|
122
|
+
"tagName": "v${version}"
|
|
123
|
+
},
|
|
124
|
+
"npm": {
|
|
125
|
+
"publish": true
|
|
126
|
+
},
|
|
127
|
+
"github": {
|
|
128
|
+
"release": true
|
|
129
|
+
},
|
|
130
|
+
"plugins": {
|
|
131
|
+
"@release-it/conventional-changelog": {
|
|
132
|
+
"preset": {
|
|
133
|
+
"name": "angular"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"prettier": {
|
|
139
|
+
"quoteProps": "consistent",
|
|
140
|
+
"singleQuote": true,
|
|
141
|
+
"tabWidth": 2,
|
|
142
|
+
"trailingComma": "es5",
|
|
143
|
+
"useTabs": false
|
|
144
|
+
},
|
|
145
|
+
"react-native-builder-bob": {
|
|
146
|
+
"source": "src",
|
|
147
|
+
"output": "lib",
|
|
148
|
+
"targets": [
|
|
149
|
+
"codegen",
|
|
150
|
+
[
|
|
151
|
+
"module",
|
|
152
|
+
{
|
|
153
|
+
"esm": true
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
"typescript",
|
|
158
|
+
{
|
|
159
|
+
"project": "tsconfig.build.json"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"codegenConfig": {
|
|
165
|
+
"name": "EnrichedMarkdownTextSpec",
|
|
166
|
+
"type": "components",
|
|
167
|
+
"jsSrcsDir": "src",
|
|
168
|
+
"outputDir": {
|
|
169
|
+
"ios": "ios/generated",
|
|
170
|
+
"android": "android/generated"
|
|
171
|
+
},
|
|
172
|
+
"android": {
|
|
173
|
+
"javaPackageName": "com.swmansion.enriched.markdown"
|
|
174
|
+
},
|
|
175
|
+
"ios": {
|
|
176
|
+
"components": {
|
|
177
|
+
"EnrichedMarkdownText": {
|
|
178
|
+
"className": "EnrichedMarkdownText"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"includesGeneratedCode": true
|
|
183
|
+
},
|
|
184
|
+
"create-react-native-library": {
|
|
185
|
+
"languages": "kotlin-objc",
|
|
186
|
+
"type": "fabric-view",
|
|
187
|
+
"version": "0.54.6"
|
|
188
|
+
}
|
|
4
189
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
dependency: {
|
|
6
|
+
platforms: {
|
|
7
|
+
android: {
|
|
8
|
+
cmakeListsPath: '../android/src/main/jni/CMakeLists.txt',
|
|
9
|
+
componentDescriptors: ['MarkdownTextComponentDescriptor'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|