react-native-ariel 0.1.0-dev.4 → 0.1.0-dev.41

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.
Files changed (21) hide show
  1. package/Ariel.podspec +2 -2
  2. package/README.md +2 -2
  3. package/android/CMakeLists.txt +14 -15
  4. package/android/build.gradle +5 -9
  5. package/android/generated/{android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs → java/com/ariel}/NativeArielSpec.java +1 -1
  6. package/android/proguard-rules.pro +4 -0
  7. package/cpp/generated/mermaid_wrapper.cpp +2368 -0
  8. package/cpp/generated/mermaid_wrapper.hpp +77 -0
  9. package/package.json +19 -7
  10. package/react-native.config.js +2 -2
  11. package/android/src/main/java/com/ariel/ArielModule.kt +0 -43
  12. package/android/src/main/java/com/ariel/ArielPackage.kt +0 -34
  13. package/lib/typescript/src/index.web.d.ts +0 -8
  14. package/lib/typescript/src/index.web.d.ts.map +0 -1
  15. /package/android/generated/{android/app/build/generated/source/codegen/jni → jni}/ArielSpec-generated.cpp +0 -0
  16. /package/android/generated/{android/app/build/generated/source/codegen/jni → jni}/ArielSpec.h +0 -0
  17. /package/android/generated/{android/app/build/generated/source/codegen/jni → jni}/CMakeLists.txt +0 -0
  18. /package/android/generated/{android/app/build/generated/source/codegen/jni → jni}/react/renderer/components/ArielSpec/ArielSpecJSI.h +0 -0
  19. /package/ios/generated/{build/generated/ios/ReactCodegen → ReactCodegen}/ArielSpec/ArielSpec-generated.mm +0 -0
  20. /package/ios/generated/{build/generated/ios/ReactCodegen → ReactCodegen}/ArielSpec/ArielSpec.h +0 -0
  21. /package/ios/generated/{build/generated/ios/ReactCodegen → ReactCodegen}/ArielSpecJSI.h +0 -0
@@ -0,0 +1,77 @@
1
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
2
+ // Trust me, you don't want to mess with it!
3
+ #pragma once
4
+ #include <jsi/jsi.h>
5
+ #include <iostream>
6
+ #include <map>
7
+ #include <memory>
8
+ #include <ReactCommon/CallInvoker.h>
9
+ #include "UniffiCallInvoker.h"
10
+
11
+ namespace react = facebook::react;
12
+ namespace jsi = facebook::jsi;
13
+
14
+ class NativeMermaidWrapper : public jsi::HostObject {
15
+ private:
16
+ // For calling back into JS from Rust.
17
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker;
18
+
19
+ protected:
20
+ std::map<std::string,jsi::Value> props;
21
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
22
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
23
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
24
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_clone_ariellayout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
25
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_free_ariellayout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
26
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_clone_arielparseddiagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
27
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_free_arielparseddiagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
28
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_clone_arieltheme(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
29
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_free_arieltheme(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
30
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
31
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
32
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_func_compute_diagram_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
33
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_func_parse_diagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
34
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
35
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
36
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
37
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_func_render_svg_from_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
38
+ jsi::Value cpp_uniffi_mermaid_wrapper_fn_func_set_timing_logs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
39
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
40
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_func_parse_diagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
41
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
42
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
43
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
44
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
45
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_func_set_timing_logs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
46
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
47
+ jsi::Value cpp_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
48
+ jsi::Value cpp_ffi_mermaid_wrapper_uniffi_contract_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
49
+ jsi::Value cpp_uniffi_internal_fn_method_ariellayout_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
50
+ jsi::Value cpp_uniffi_internal_fn_method_arielparseddiagram_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
51
+ jsi::Value cpp_uniffi_internal_fn_method_arieltheme_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
52
+
53
+ public:
54
+ NativeMermaidWrapper(jsi::Runtime &rt, std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker);
55
+ virtual ~NativeMermaidWrapper();
56
+
57
+ /**
58
+ * The entry point into the crate.
59
+ *
60
+ * React Native must call `NativeMermaidWrapper.registerModule(rt, callInvoker)` before using
61
+ * the Javascript interface.
62
+ */
63
+ static void registerModule(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker);
64
+
65
+ /**
66
+ * Some cleanup into the crate goes here.
67
+ *
68
+ * Current implementation is empty, however, this is not guaranteed to always be the case.
69
+ *
70
+ * Clients should call `NativeMermaidWrapper.unregisterModule(rt)` after final use where possible.
71
+ */
72
+ static void unregisterModule(jsi::Runtime &rt);
73
+
74
+ virtual jsi::Value get(jsi::Runtime& rt, const jsi::PropNameID& name);
75
+ virtual void set(jsi::Runtime& rt,const jsi::PropNameID& name,const jsi::Value& value);
76
+ virtual std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& rt);
77
+ };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "react-native-ariel",
3
- "version": "0.1.0-dev.4",
3
+ "version": "0.1.0-dev.41",
4
4
  "description": "Mermaid diagrams for React Native and React Native Web. No DOM. No WebView. Pure Rust.",
5
5
  "main": "./lib/module/index.js",
6
6
  "source": "./src/index.tsx",
7
7
  "types": "./lib/typescript/src/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "browser": "./src/index.web.ts",
10
11
  "source": "./src/index.tsx",
11
12
  "types": "./lib/typescript/src/index.d.ts",
12
13
  "default": "./lib/module/index.js"
@@ -53,18 +54,29 @@
53
54
  "keywords": [
54
55
  "react-native",
55
56
  "ios",
56
- "android"
57
+ "android",
58
+ "mermaid",
59
+ "mermaid-js",
60
+ "svg",
61
+ "diagram",
62
+ "flowchart",
63
+ "rust",
64
+ "wasm",
65
+ "web",
66
+ "no-webview",
67
+ "turbo-module",
68
+ "jsi"
57
69
  ],
58
70
  "repository": {
59
71
  "type": "git",
60
- "url": "git+https://github.com/rinfi/ariel.git"
72
+ "url": "git+https://github.com/rinfimate/ariel.git"
61
73
  },
62
- "author": "Rochanglien Infimate <r.infimate@gmail.com> (https://github.com/rinfi)",
74
+ "author": "Rochanglien Infimate <r.infimate@gmail.com> (https://github.com/rinfimate)",
63
75
  "license": "MIT",
64
76
  "bugs": {
65
- "url": "https://github.com/rinfi/ariel/issues"
77
+ "url": "https://github.com/rinfimate/ariel/issues"
66
78
  },
67
- "homepage": "https://github.com/rinfi/ariel#readme",
79
+ "homepage": "https://github.com/rinfimate/ariel#readme",
68
80
  "publishConfig": {
69
81
  "registry": "https://registry.npmjs.org/"
70
82
  },
@@ -123,7 +135,7 @@
123
135
  "android": {
124
136
  "javaPackageName": "com.ariel"
125
137
  },
126
- "includesGeneratedCode": false
138
+ "includesGeneratedCode": true
127
139
  },
128
140
  "jest": {
129
141
  "preset": "@react-native/jest-preset",
@@ -5,9 +5,9 @@ module.exports = {
5
5
  dependency: {
6
6
  platforms: {
7
7
  android: {
8
- cmakeListsPath: 'generated/jni/CMakeLists.txt',
8
+ cmakeListsPath: 'CMakeLists.txt',
9
9
  cxxModuleCMakeListsModuleName: 'react-native-ariel',
10
- cxxModuleCMakeListsPath: 'CMakeLists.txt',
10
+ cxxModuleCMakeListsPath: 'android/CMakeLists.txt',
11
11
  cxxModuleHeaderName: 'ArielImpl',
12
12
  },
13
13
  },
@@ -1,43 +0,0 @@
1
- // Generated by uniffi-bindgen-react-native
2
- package com.ariel
3
-
4
- import com.facebook.react.bridge.ReactApplicationContext
5
- import com.facebook.react.module.annotations.ReactModule
6
- import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
7
-
8
- @ReactModule(name = ArielModule.NAME)
9
- class ArielModule(reactContext: ReactApplicationContext) :
10
- NativeArielSpec(reactContext) {
11
-
12
- override fun getName(): String {
13
- return NAME
14
- }
15
-
16
- // Two native methods implemented in cpp-adapter.cpp, and ultimately
17
- // react-native-ariel.cpp
18
-
19
- external fun nativeInstallRustCrate(runtimePointer: Long, callInvoker: CallInvokerHolder): Boolean
20
- external fun nativeCleanupRustCrate(runtimePointer: Long): Boolean
21
-
22
- override fun installRustCrate(): Boolean {
23
- val context = this.reactApplicationContext
24
- return nativeInstallRustCrate(
25
- context.javaScriptContextHolder!!.get(),
26
- context.jsCallInvokerHolder!!
27
- )
28
- }
29
-
30
- override fun cleanupRustCrate(): Boolean {
31
- return nativeCleanupRustCrate(
32
- this.reactApplicationContext.javaScriptContextHolder!!.get()
33
- )
34
- }
35
-
36
- companion object {
37
- const val NAME = "Ariel"
38
-
39
- init {
40
- System.loadLibrary("react-native-ariel")
41
- }
42
- }
43
- }
@@ -1,34 +0,0 @@
1
- // Generated by uniffi-bindgen-react-native
2
- package com.ariel
3
-
4
- import com.facebook.react.TurboReactPackage
5
- import com.facebook.react.bridge.NativeModule
6
- import com.facebook.react.bridge.ReactApplicationContext
7
- import com.facebook.react.module.model.ReactModuleInfo
8
- import com.facebook.react.module.model.ReactModuleInfoProvider
9
- import java.util.HashMap
10
-
11
- class ArielPackage : TurboReactPackage() {
12
- override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
13
- return if (name == ArielModule.NAME) {
14
- ArielModule(reactContext)
15
- } else {
16
- null
17
- }
18
- }
19
-
20
- override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
21
- return ReactModuleInfoProvider {
22
- val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
23
- moduleInfos[ArielModule.NAME] = ReactModuleInfo(
24
- ArielModule.NAME,
25
- ArielModule.NAME,
26
- false, // canOverrideExistingModule
27
- false, // needsEagerInit
28
- false, // isCxxModule
29
- true // isTurboModule
30
- )
31
- moduleInfos
32
- }
33
- }
34
- }
@@ -1,8 +0,0 @@
1
- export * from './generated/web/mermaid_wrapper';
2
- import * as mermaid_wrapper from './generated/web/mermaid_wrapper';
3
- export declare function uniffiInitAsync(): Promise<void>;
4
- declare const _default: {
5
- mermaid_wrapper: typeof mermaid_wrapper;
6
- };
7
- export default _default;
8
- //# sourceMappingURL=index.web.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAEA,cAAc,iCAAiC,CAAC;AAKhD,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AAKnE,wBAAsB,eAAe,kBAOpC;;;;AAGD,wBAEE"}