react-native-nitro-markdown 0.1.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/README.md +276 -0
- package/android/CMakeLists.txt +40 -0
- package/android/build.gradle +92 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/cpp/cpp-adapter.cpp +7 -0
- package/android/src/main/java/com/nitromarkdown/NitroMarkdownPackage.kt +23 -0
- package/cpp/CMakeLists.txt +46 -0
- package/cpp/bindings/HybridMarkdownParser.cpp +112 -0
- package/cpp/bindings/HybridMarkdownParser.hpp +28 -0
- package/cpp/core/MD4CParser.cpp +442 -0
- package/cpp/core/MD4CParser.hpp +21 -0
- package/cpp/core/MarkdownTypes.hpp +119 -0
- package/cpp/md4c/md4c.c +6492 -0
- package/cpp/md4c/md4c.h +407 -0
- package/ios/NitroMarkdown-Bridging-Header.h +14 -0
- package/lib/commonjs/Markdown.nitro.js +6 -0
- package/lib/commonjs/Markdown.nitro.js.map +1 -0
- package/lib/commonjs/MarkdownJS.nitro.js +114 -0
- package/lib/commonjs/MarkdownJS.nitro.js.map +1 -0
- package/lib/commonjs/index.js +19 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/Markdown.nitro.js +4 -0
- package/lib/module/Markdown.nitro.js.map +1 -0
- package/lib/module/MarkdownJS.nitro.js +107 -0
- package/lib/module/MarkdownJS.nitro.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/Markdown.nitro.d.ts +13 -0
- package/lib/typescript/Markdown.nitro.d.ts.map +1 -0
- package/lib/typescript/MarkdownJS.nitro.d.ts +33 -0
- package/lib/typescript/MarkdownJS.nitro.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +22 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/nitro.json +16 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroMarkdown+autolinking.cmake +81 -0
- package/nitrogen/generated/android/NitroMarkdown+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroMarkdownOnLoad.cpp +44 -0
- package/nitrogen/generated/android/NitroMarkdownOnLoad.hpp +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/nitromarkdown/NitroMarkdownOnLoad.kt +35 -0
- package/nitrogen/generated/ios/NitroMarkdown+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroMarkdown-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/NitroMarkdown-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/NitroMarkdown-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/NitroMarkdownAutolinking.mm +35 -0
- package/nitrogen/generated/ios/NitroMarkdownAutolinking.swift +12 -0
- package/nitrogen/generated/shared/c++/HybridMarkdownParserSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridMarkdownParserSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/ParserOptions.hpp +79 -0
- package/package.json +101 -0
- package/react-native-nitro-markdown.podspec +42 -0
- package/src/Markdown.nitro.ts +12 -0
- package/src/MarkdownJS.nitro.ts +113 -0
- package/src/index.ts +65 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Pure JavaScript implementation using JSI
|
|
4
|
+
export class JSMarkdownParser {
|
|
5
|
+
parseImpl(text, options) {
|
|
6
|
+
// Simple regex-based parser for comparison
|
|
7
|
+
// This is much slower than the C++ version but demonstrates JSI usage
|
|
8
|
+
const root = {
|
|
9
|
+
type: 'document',
|
|
10
|
+
children: []
|
|
11
|
+
};
|
|
12
|
+
const lines = text.split('\n');
|
|
13
|
+
let i = 0;
|
|
14
|
+
while (i < lines.length) {
|
|
15
|
+
const line = lines[i].trim();
|
|
16
|
+
if (!line) {
|
|
17
|
+
i++;
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Headers
|
|
22
|
+
const headerMatch = line.match(/^(#{1,6})\s+(.+)$/);
|
|
23
|
+
if (headerMatch) {
|
|
24
|
+
root.children.push({
|
|
25
|
+
type: 'heading',
|
|
26
|
+
level: headerMatch[1].length,
|
|
27
|
+
children: [{
|
|
28
|
+
type: 'text',
|
|
29
|
+
content: headerMatch[2]
|
|
30
|
+
}]
|
|
31
|
+
});
|
|
32
|
+
i++;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Bold
|
|
37
|
+
const boldMatch = line.match(/\*\*(.+?)\*\*/);
|
|
38
|
+
if (boldMatch) {
|
|
39
|
+
root.children.push({
|
|
40
|
+
type: 'paragraph',
|
|
41
|
+
children: [{
|
|
42
|
+
type: 'bold',
|
|
43
|
+
children: [{
|
|
44
|
+
type: 'text',
|
|
45
|
+
content: boldMatch[1]
|
|
46
|
+
}]
|
|
47
|
+
}]
|
|
48
|
+
});
|
|
49
|
+
i++;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Default paragraph
|
|
54
|
+
root.children.push({
|
|
55
|
+
type: 'paragraph',
|
|
56
|
+
children: [{
|
|
57
|
+
type: 'text',
|
|
58
|
+
content: line
|
|
59
|
+
}]
|
|
60
|
+
});
|
|
61
|
+
i++;
|
|
62
|
+
}
|
|
63
|
+
return root;
|
|
64
|
+
}
|
|
65
|
+
parse(text, options = {
|
|
66
|
+
gfm: true,
|
|
67
|
+
math: true
|
|
68
|
+
}) {
|
|
69
|
+
return this.parseImpl(text, options);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// JSI-enabled version using Nitro but with JS implementation
|
|
74
|
+
export class JSINitroMarkdownParser {
|
|
75
|
+
parse(text, options = {
|
|
76
|
+
gfm: true,
|
|
77
|
+
math: true
|
|
78
|
+
}) {
|
|
79
|
+
// This would use JSI to call into JavaScriptCore
|
|
80
|
+
// For now, we'll simulate it
|
|
81
|
+
const parser = new JSMarkdownParser();
|
|
82
|
+
return parser.parse(text, options);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Hybrid approach: C++ for complex parsing, JS for simple cases
|
|
87
|
+
export class HybridMarkdownParser {
|
|
88
|
+
constructor() {
|
|
89
|
+
// In real implementation, this would be the Nitro C++ parser
|
|
90
|
+
this.cppParser = null;
|
|
91
|
+
this.jsParser = new JSMarkdownParser();
|
|
92
|
+
}
|
|
93
|
+
parse(text, options = {
|
|
94
|
+
gfm: true,
|
|
95
|
+
math: true
|
|
96
|
+
}) {
|
|
97
|
+
// Use C++ parser for complex cases, JS for simple
|
|
98
|
+
if (text.length > 1000 || options.gfm || options.math) {
|
|
99
|
+
// Would call C++ parser via Nitro
|
|
100
|
+
return this.jsParser.parse(text, options);
|
|
101
|
+
} else {
|
|
102
|
+
// Use JS parser for simple cases
|
|
103
|
+
return this.jsParser.parse(text, options);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=MarkdownJS.nitro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["JSMarkdownParser","parseImpl","text","options","root","type","children","lines","split","i","length","line","trim","headerMatch","match","push","level","content","boldMatch","parse","gfm","math","JSINitroMarkdownParser","parser","HybridMarkdownParser","constructor","cppParser","jsParser"],"sourceRoot":"../../src","sources":["MarkdownJS.nitro.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
|
+
export const MarkdownParserModule = NitroModules.createHybridObject('MarkdownParser');
|
|
5
|
+
export function parseMarkdown(text) {
|
|
6
|
+
const jsonStr = MarkdownParserModule.parse(text);
|
|
7
|
+
return JSON.parse(jsonStr);
|
|
8
|
+
}
|
|
9
|
+
export function parseMarkdownWithOptions(text, options) {
|
|
10
|
+
const jsonStr = MarkdownParserModule.parseWithOptions(text, options);
|
|
11
|
+
return JSON.parse(jsonStr);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NitroModules","MarkdownParserModule","createHybridObject","parseMarkdown","text","jsonStr","parse","JSON","parseMarkdownWithOptions","options","parseWithOptions"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAgDzD,OAAO,MAAMC,oBAAoB,GAC/BD,YAAY,CAACE,kBAAkB,CAAiB,gBAAgB,CAAC;AAEnE,OAAO,SAASC,aAAaA,CAACC,IAAY,EAAgB;EACxD,MAAMC,OAAO,GAAGJ,oBAAoB,CAACK,KAAK,CAACF,IAAI,CAAC;EAChD,OAAOG,IAAI,CAACD,KAAK,CAACD,OAAO,CAAC;AAC5B;AAEA,OAAO,SAASG,wBAAwBA,CACtCJ,IAAY,EACZK,OAAsB,EACR;EACd,MAAMJ,OAAO,GAAGJ,oBAAoB,CAACS,gBAAgB,CAACN,IAAI,EAAEK,OAAO,CAAC;EACpE,OAAOF,IAAI,CAACD,KAAK,CAACD,OAAO,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
export interface ParserOptions {
|
|
3
|
+
gfm?: boolean;
|
|
4
|
+
math?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface MarkdownParser extends HybridObject<{
|
|
7
|
+
ios: 'c++';
|
|
8
|
+
android: 'c++';
|
|
9
|
+
}> {
|
|
10
|
+
parse(text: string): string;
|
|
11
|
+
parseWithOptions(text: string, options: ParserOptions): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Markdown.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.nitro.d.ts","sourceRoot":"","sources":["../../src/Markdown.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,cACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACpD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC;CAChE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface MarkdownNode {
|
|
2
|
+
type: string;
|
|
3
|
+
content?: string;
|
|
4
|
+
level?: number;
|
|
5
|
+
href?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
ordered?: boolean;
|
|
10
|
+
start?: number;
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
isHeader?: boolean;
|
|
13
|
+
align?: string;
|
|
14
|
+
children?: MarkdownNode[];
|
|
15
|
+
}
|
|
16
|
+
export interface ParserOptions {
|
|
17
|
+
gfm?: boolean;
|
|
18
|
+
math?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class JSMarkdownParser {
|
|
21
|
+
private parseImpl;
|
|
22
|
+
parse(text: string, options?: ParserOptions): MarkdownNode;
|
|
23
|
+
}
|
|
24
|
+
export declare class JSINitroMarkdownParser {
|
|
25
|
+
parse(text: string, options?: ParserOptions): MarkdownNode;
|
|
26
|
+
}
|
|
27
|
+
export declare class HybridMarkdownParser {
|
|
28
|
+
private cppParser;
|
|
29
|
+
private jsParser;
|
|
30
|
+
constructor();
|
|
31
|
+
parse(text: string, options?: ParserOptions): MarkdownNode;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=MarkdownJS.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownJS.nitro.d.ts","sourceRoot":"","sources":["../../src/MarkdownJS.nitro.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAGD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS;IAmDjB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAyC,GAAG,YAAY;CAGtF;AAGD,qBAAa,sBAAsB;IACjC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAyC,GAAG,YAAY;CAMtF;AAGD,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,QAAQ,CAAmB;;IAQnC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAyC,GAAG,YAAY;CAUtF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MarkdownParser, ParserOptions } from './Markdown.nitro';
|
|
2
|
+
export type { ParserOptions } from './Markdown.nitro';
|
|
3
|
+
export interface MarkdownNode {
|
|
4
|
+
type: 'document' | 'heading' | 'paragraph' | 'text' | 'bold' | 'italic' | 'strikethrough' | 'link' | 'image' | 'code_inline' | 'code_block' | 'blockquote' | 'horizontal_rule' | 'line_break' | 'soft_break' | 'table' | 'table_head' | 'table_body' | 'table_row' | 'table_cell' | 'list' | 'list_item' | 'task_list_item' | 'math_inline' | 'math_block' | 'html_block' | 'html_inline';
|
|
5
|
+
content?: string;
|
|
6
|
+
level?: number;
|
|
7
|
+
href?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
ordered?: boolean;
|
|
12
|
+
start?: number;
|
|
13
|
+
checked?: boolean;
|
|
14
|
+
isHeader?: boolean;
|
|
15
|
+
align?: string;
|
|
16
|
+
children?: MarkdownNode[];
|
|
17
|
+
}
|
|
18
|
+
export declare const MarkdownParserModule: MarkdownParser;
|
|
19
|
+
export declare function parseMarkdown(text: string): MarkdownNode;
|
|
20
|
+
export declare function parseMarkdownWithOptions(text: string, options: ParserOptions): MarkdownNode;
|
|
21
|
+
export { MarkdownParser };
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,IAAI,EACA,UAAU,GACV,SAAS,GACT,WAAW,GACX,MAAM,GACN,MAAM,GACN,QAAQ,GACR,eAAe,GACf,MAAM,GACN,OAAO,GACP,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,WAAW,GACX,gBAAgB,GAChB,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,aAAa,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB,gBACkC,CAAC;AAEpE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAGxD;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,YAAY,CAGd;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/nitro.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cxxNamespace": ["NitroMarkdown"],
|
|
3
|
+
"ios": {
|
|
4
|
+
"iosModuleName": "NitroMarkdown"
|
|
5
|
+
},
|
|
6
|
+
"android": {
|
|
7
|
+
"androidNamespace": ["com", "nitromarkdown"],
|
|
8
|
+
"androidCxxLibName": "NitroMarkdown"
|
|
9
|
+
},
|
|
10
|
+
"autolinking": {
|
|
11
|
+
"MarkdownParser": {
|
|
12
|
+
"cpp": "HybridMarkdownParser"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
** linguist-generated=true
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NitroMarkdown+autolinking.cmake
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a CMake file that adds all files generated by Nitrogen
|
|
9
|
+
# to the current CMake project.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your CMakeLists.txt:
|
|
12
|
+
# ```cmake
|
|
13
|
+
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/NitroMarkdown+autolinking.cmake)
|
|
14
|
+
# ```
|
|
15
|
+
|
|
16
|
+
# Define a flag to check if we are building properly
|
|
17
|
+
add_definitions(-DBUILDING_NITROMARKDOWN_WITH_GENERATED_CMAKE_PROJECT)
|
|
18
|
+
|
|
19
|
+
# Enable Raw Props parsing in react-native (for Nitro Views)
|
|
20
|
+
add_definitions(-DRN_SERIALIZABLE_STATE)
|
|
21
|
+
|
|
22
|
+
# Add all headers that were generated by Nitrogen
|
|
23
|
+
include_directories(
|
|
24
|
+
"../nitrogen/generated/shared/c++"
|
|
25
|
+
"../nitrogen/generated/android/c++"
|
|
26
|
+
"../nitrogen/generated/android/"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# Add all .cpp sources that were generated by Nitrogen
|
|
30
|
+
target_sources(
|
|
31
|
+
# CMake project name (Android C++ library name)
|
|
32
|
+
NitroMarkdown PRIVATE
|
|
33
|
+
# Autolinking Setup
|
|
34
|
+
../nitrogen/generated/android/NitroMarkdownOnLoad.cpp
|
|
35
|
+
# Shared Nitrogen C++ sources
|
|
36
|
+
../nitrogen/generated/shared/c++/HybridMarkdownParserSpec.cpp
|
|
37
|
+
# Android-specific Nitrogen C++ sources
|
|
38
|
+
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
42
|
+
# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
|
|
43
|
+
target_compile_definitions(
|
|
44
|
+
NitroMarkdown PRIVATE
|
|
45
|
+
-DFOLLY_NO_CONFIG=1
|
|
46
|
+
-DFOLLY_HAVE_CLOCK_GETTIME=1
|
|
47
|
+
-DFOLLY_USE_LIBCPP=1
|
|
48
|
+
-DFOLLY_CFG_NO_COROUTINES=1
|
|
49
|
+
-DFOLLY_MOBILE=1
|
|
50
|
+
-DFOLLY_HAVE_RECVMMSG=1
|
|
51
|
+
-DFOLLY_HAVE_PTHREAD=1
|
|
52
|
+
# Once we target android-23 above, we can comment
|
|
53
|
+
# the following line. NDK uses GNU style stderror_r() after API 23.
|
|
54
|
+
-DFOLLY_HAVE_XSI_STRERROR_R=1
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Add all libraries required by the generated specs
|
|
58
|
+
find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
|
|
59
|
+
find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
|
|
60
|
+
find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
|
|
61
|
+
|
|
62
|
+
# Link all libraries together
|
|
63
|
+
target_link_libraries(
|
|
64
|
+
NitroMarkdown
|
|
65
|
+
fbjni::fbjni # <-- Facebook C++ JNI helpers
|
|
66
|
+
ReactAndroid::jsi # <-- RN: JSI
|
|
67
|
+
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# Link react-native (different prefab between RN 0.75 and RN 0.76)
|
|
71
|
+
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
|
|
72
|
+
target_link_libraries(
|
|
73
|
+
NitroMarkdown
|
|
74
|
+
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
|
|
75
|
+
)
|
|
76
|
+
else()
|
|
77
|
+
target_link_libraries(
|
|
78
|
+
NitroMarkdown
|
|
79
|
+
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
|
80
|
+
)
|
|
81
|
+
endif()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdown+autolinking.gradle
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
9
|
+
/// to the current Gradle project.
|
|
10
|
+
///
|
|
11
|
+
/// To use it, add this to your build.gradle:
|
|
12
|
+
/// ```gradle
|
|
13
|
+
/// apply from: '../nitrogen/generated/android/NitroMarkdown+autolinking.gradle'
|
|
14
|
+
/// ```
|
|
15
|
+
|
|
16
|
+
logger.warn("[NitroModules] 🔥 NitroMarkdown is boosted by nitro!")
|
|
17
|
+
|
|
18
|
+
android {
|
|
19
|
+
sourceSets {
|
|
20
|
+
main {
|
|
21
|
+
java.srcDirs += [
|
|
22
|
+
// Nitrogen files
|
|
23
|
+
"${project.projectDir}/../nitrogen/generated/android/kotlin"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdownOnLoad.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#ifndef BUILDING_NITROMARKDOWN_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
+
#error NitroMarkdownOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#include "NitroMarkdownOnLoad.hpp"
|
|
13
|
+
|
|
14
|
+
#include <jni.h>
|
|
15
|
+
#include <fbjni/fbjni.h>
|
|
16
|
+
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
|
+
|
|
18
|
+
#include "HybridMarkdownParser.hpp"
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::NitroMarkdown {
|
|
21
|
+
|
|
22
|
+
int initialize(JavaVM* vm) {
|
|
23
|
+
using namespace margelo::nitro;
|
|
24
|
+
using namespace margelo::nitro::NitroMarkdown;
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
return facebook::jni::initialize(vm, [] {
|
|
28
|
+
// Register native JNI methods
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Register Nitro Hybrid Objects
|
|
32
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
33
|
+
"MarkdownParser",
|
|
34
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
35
|
+
static_assert(std::is_default_constructible_v<HybridMarkdownParser>,
|
|
36
|
+
"The HybridObject \"HybridMarkdownParser\" is not default-constructible! "
|
|
37
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
38
|
+
return std::make_shared<HybridMarkdownParser>();
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
} // namespace margelo::nitro::NitroMarkdown
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdownOnLoad.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <jni.h>
|
|
9
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
10
|
+
|
|
11
|
+
namespace margelo::nitro::NitroMarkdown {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initializes the native (C++) part of NitroMarkdown, and autolinks all Hybrid Objects.
|
|
15
|
+
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
|
|
16
|
+
* Example:
|
|
17
|
+
* ```cpp (cpp-adapter.cpp)
|
|
18
|
+
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
19
|
+
* return margelo::nitro::NitroMarkdown::initialize(vm);
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
int initialize(JavaVM* vm);
|
|
24
|
+
|
|
25
|
+
} // namespace margelo::nitro::NitroMarkdown
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/nitromarkdown/NitroMarkdownOnLoad.kt
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdownOnLoad.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.com.nitromarkdown
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class NitroMarkdownOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "NitroMarkdownOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "NitroMarkdown".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading NitroMarkdown C++ library...")
|
|
25
|
+
System.loadLibrary("NitroMarkdown")
|
|
26
|
+
Log.i(TAG, "Successfully loaded NitroMarkdown C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load NitroMarkdown C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NitroMarkdown+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/NitroMarkdown+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 NitroMarkdown is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/NitroMarkdown-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only C)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdown-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "NitroMarkdown-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::NitroMarkdown::bridge::swift {
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
} // namespace margelo::nitro::NitroMarkdown::bridge::swift
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdown-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// Forward declarations of Swift defined types
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// Include C++ defined types
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
21
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
22
|
+
*/
|
|
23
|
+
namespace margelo::nitro::NitroMarkdown::bridge::swift {
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
} // namespace margelo::nitro::NitroMarkdown::bridge::swift
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdown-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// Include C++ defined types
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// C++ helpers for Swift
|
|
17
|
+
#include "NitroMarkdown-Swift-Cxx-Bridge.hpp"
|
|
18
|
+
|
|
19
|
+
// Common C++ types used in Swift
|
|
20
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
21
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
22
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
23
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
24
|
+
|
|
25
|
+
// Forward declarations of Swift defined types
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// Include Swift defined types
|
|
29
|
+
#if __has_include("NitroMarkdown-Swift.h")
|
|
30
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
31
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroMarkdown".
|
|
32
|
+
#include "NitroMarkdown-Swift.h"
|
|
33
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
34
|
+
#elif __has_include(<NitroMarkdown/NitroMarkdown-Swift.h>)
|
|
35
|
+
#include <NitroMarkdown/NitroMarkdown-Swift.h>
|
|
36
|
+
#else
|
|
37
|
+
#error NitroMarkdown's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroMarkdown", and try building the app first.
|
|
38
|
+
#endif
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdownAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridMarkdownParser.hpp"
|
|
14
|
+
|
|
15
|
+
@interface NitroMarkdownAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation NitroMarkdownAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::NitroMarkdown;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"MarkdownParser",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
static_assert(std::is_default_constructible_v<HybridMarkdownParser>,
|
|
28
|
+
"The HybridObject \"HybridMarkdownParser\" is not default-constructible! "
|
|
29
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
30
|
+
return std::make_shared<HybridMarkdownParser>();
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMarkdownAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
public final class NitroMarkdownAutolinking {
|
|
9
|
+
public typealias bridge = margelo.nitro.NitroMarkdown.bridge.swift
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
}
|