@granite-js/react-native 0.1.19 → 0.1.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @granite-js/react-native
2
2
 
3
+ ## 0.1.20
4
+
5
+ ### Patch Changes
6
+
7
+ - 1df5883: update package.json meta to supports any moduleResolutions
8
+ - Updated dependencies [1df5883]
9
+ - Updated dependencies [a93bf1e]
10
+ - @granite-js/native@0.1.20
11
+ - @granite-js/image@0.1.20
12
+ - @granite-js/mpack@0.1.20
13
+ - @granite-js/jest@0.1.20
14
+ - @granite-js/lottie@0.1.20
15
+ - @granite-js/style-utils@0.1.20
16
+ - @granite-js/cli@0.1.20
17
+ - @granite-js/plugin-core@0.1.20
18
+
3
19
  ## 0.1.19
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1 @@
1
+ export * from './dist/async-bridges';
@@ -0,0 +1 @@
1
+ export * from './dist/constant-bridges';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @public
3
+ * @category Screen Control
4
+ * @kind function
5
+ * @name closeView
6
+ * @description Function that closes the current screen. It can be used when you want to exit a service by pressing a "Close" button.
7
+ * @returns {Promise<void>}
8
+ *
9
+ * @example
10
+ * ### Close screen with close button
11
+ *
12
+ * ```tsx
13
+ * import { Button } from 'react-native';
14
+ * import { closeView } from '@granite-js/react-native';
15
+ *
16
+ * function CloseButton() {
17
+ * return <Button title="Close" onPress={closeView} />;
18
+ * }
19
+ * ```
20
+ */
21
+ declare function closeView(): Promise<void>;
22
+
23
+ /**
24
+ * @public
25
+ * @kind function
26
+ * @category Screen Navigation
27
+ *
28
+ * @name openURL
29
+ * @signature
30
+ * ```typescript
31
+ * function openURL(url: string): Promise<any>;
32
+ * ```
33
+ *
34
+ * @description
35
+ * Opens the specified URL in the device's default browser or related app.
36
+ * This function uses the [`Linking.openURL`](https://reactnative.dev/docs/0.72/linking#openurl) method from `react-native` to open the URL.
37
+ *
38
+ * @param {string} url URL address to open
39
+ * @returns {Promise<any>} Promise that resolves when the URL is successfully opened
40
+ *
41
+ * @example
42
+ *
43
+ * ### Open external URL
44
+ *
45
+ * ```tsx
46
+ * import { openURL } from '@granite-js/react-native';
47
+ * import { Button } from 'react-native';
48
+ *
49
+ * function Page() {
50
+ * const handlePress = () => {
51
+ * openURL('https://google.com');
52
+ * };
53
+ *
54
+ * return <Button title="Open Google Website" onPress={handlePress} />;
55
+ * }
56
+ * ```
57
+ */
58
+ declare function openURL(url: string): Promise<any>;
59
+
60
+ export { closeView, openURL };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/async-bridges.ts
21
+ var async_bridges_exports = {};
22
+ __export(async_bridges_exports, {
23
+ closeView: () => closeView,
24
+ openURL: () => openURL
25
+ });
26
+ module.exports = __toCommonJS(async_bridges_exports);
27
+
28
+ // src/native-modules/natives/GraniteModule.ts
29
+ var import_react_native = require("react-native");
30
+ var GraniteModule = import_react_native.TurboModuleRegistry.getEnforcing("GraniteModule");
31
+
32
+ // src/native-modules/natives/closeView.ts
33
+ async function closeView() {
34
+ return GraniteModule.closeView();
35
+ }
36
+
37
+ // src/native-modules/natives/openURL.ts
38
+ var import_react_native2 = require("react-native");
39
+ function openURL(url) {
40
+ return import_react_native2.Linking.openURL(url);
41
+ }
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ closeView,
45
+ openURL
46
+ });
@@ -0,0 +1,18 @@
1
+ import {
2
+ GraniteModule
3
+ } from "./chunk-A3JGM5OI.mjs";
4
+
5
+ // src/native-modules/natives/closeView.ts
6
+ async function closeView() {
7
+ return GraniteModule.closeView();
8
+ }
9
+
10
+ // src/native-modules/natives/openURL.ts
11
+ import { Linking } from "react-native";
12
+ function openURL(url) {
13
+ return Linking.openURL(url);
14
+ }
15
+ export {
16
+ closeView,
17
+ openURL
18
+ };
@@ -0,0 +1,7 @@
1
+ // src/native-modules/natives/GraniteModule.ts
2
+ import { TurboModuleRegistry } from "react-native";
3
+ var GraniteModule = TurboModuleRegistry.getEnforcing("GraniteModule");
4
+
5
+ export {
6
+ GraniteModule
7
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @public
3
+ * @name getSchemeUri
4
+ * @category Environment Check
5
+ * @kind function
6
+ * @description Returns the scheme value when first entering the screen. URI changes due to page navigation are not reflected.
7
+ * @returns {string} Returns the scheme value when first entering the screen.
8
+ *
9
+ * @example
10
+ * ### Get initial scheme value
11
+ *
12
+ * ```tsx
13
+ * import { getSchemeUri } from '@granite-js/react-native';
14
+ * import { Text } from 'react-native';
15
+ *
16
+ * function MyPage() {
17
+ * const schemeUri = getSchemeUri();
18
+ *
19
+ * return <Text>Initial scheme value: {schemeUri}</Text>
20
+ * }
21
+ * ```
22
+ */
23
+ declare function getSchemeUri(): string;
24
+
25
+ export { getSchemeUri };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/constant-bridges.ts
21
+ var constant_bridges_exports = {};
22
+ __export(constant_bridges_exports, {
23
+ getSchemeUri: () => getSchemeUri
24
+ });
25
+ module.exports = __toCommonJS(constant_bridges_exports);
26
+
27
+ // src/native-modules/natives/GraniteModule.ts
28
+ var import_react_native = require("react-native");
29
+ var GraniteModule = import_react_native.TurboModuleRegistry.getEnforcing("GraniteModule");
30
+
31
+ // src/native-modules/natives/getSchemeUri.ts
32
+ function getSchemeUri() {
33
+ return GraniteModule.schemeUri;
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ getSchemeUri
38
+ });
@@ -0,0 +1,11 @@
1
+ import {
2
+ GraniteModule
3
+ } from "./chunk-A3JGM5OI.mjs";
4
+
5
+ // src/native-modules/natives/getSchemeUri.ts
6
+ function getSchemeUri() {
7
+ return GraniteModule.schemeUri;
8
+ }
9
+ export {
10
+ getSchemeUri
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granite-js/react-native",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "The Granite Framework",
5
5
  "bin": {
6
6
  "granite": "./bin/cli.js"
@@ -20,12 +20,24 @@
20
20
  "default": "./src/index.ts"
21
21
  },
22
22
  "./async-bridges": {
23
- "types": "./src/async-bridges.ts",
24
- "default": "./src/async-bridges.ts"
23
+ "import": {
24
+ "types": "./dist/async-bridges.d.mts",
25
+ "default": "./dist/async-bridges.mjs"
26
+ },
27
+ "require": {
28
+ "types": "./dist/async-bridges.d.ts",
29
+ "default": "./dist/async-bridges.js"
30
+ }
25
31
  },
26
32
  "./constant-bridges": {
27
- "types": "./src/constant-bridges.ts",
28
- "default": "./src/constant-bridges.ts"
33
+ "import": {
34
+ "types": "./dist/constant-bridges.d.mts",
35
+ "default": "./dist/constant-bridges.mjs"
36
+ },
37
+ "require": {
38
+ "types": "./dist/constant-bridges.d.ts",
39
+ "default": "./dist/constant-bridges.js"
40
+ }
29
41
  },
30
42
  "./config": {
31
43
  "import": {
@@ -74,7 +86,7 @@
74
86
  "@babel/core": "^7.24.9",
75
87
  "@babel/preset-env": "^7.24.8",
76
88
  "@babel/preset-typescript": "^7.24.7",
77
- "@granite-js/native": "0.1.19",
89
+ "@granite-js/native": "0.1.20",
78
90
  "@testing-library/dom": "^10.4.0",
79
91
  "@testing-library/react": "^16.1.0",
80
92
  "@types/babel__core": "^7",
@@ -100,13 +112,13 @@
100
112
  "react-native": "*"
101
113
  },
102
114
  "dependencies": {
103
- "@granite-js/cli": "0.1.19",
104
- "@granite-js/image": "0.1.19",
105
- "@granite-js/jest": "0.1.19",
106
- "@granite-js/lottie": "0.1.19",
107
- "@granite-js/mpack": "0.1.19",
108
- "@granite-js/plugin-core": "0.1.19",
109
- "@granite-js/style-utils": "0.1.19",
115
+ "@granite-js/cli": "0.1.20",
116
+ "@granite-js/image": "0.1.20",
117
+ "@granite-js/jest": "0.1.20",
118
+ "@granite-js/lottie": "0.1.20",
119
+ "@granite-js/mpack": "0.1.20",
120
+ "@granite-js/plugin-core": "0.1.20",
121
+ "@granite-js/style-utils": "0.1.20",
110
122
  "es-toolkit": "^1.39.8",
111
123
  "react-native-url-polyfill": "1.3.0"
112
124
  }
package/types.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/types/global.d.ts';