@granite-js/react-native 0.1.23-next.15 → 0.1.23-next.18

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,50 @@
1
1
  # @granite-js/react-native
2
2
 
3
+ ## 0.1.23-next.18
4
+
5
+ ### Patch Changes
6
+
7
+ - fix
8
+ - Updated dependencies
9
+ - @granite-js/plugin-core@0.1.23-next.18
10
+ - @granite-js/style-utils@0.1.23-next.18
11
+ - @granite-js/lottie@0.1.23-next.18
12
+ - @granite-js/native@0.1.23-next.18
13
+ - @granite-js/image@0.1.23-next.18
14
+ - @granite-js/mpack@0.1.23-next.18
15
+ - @granite-js/jest@0.1.23-next.18
16
+ - @granite-js/cli@0.1.23-next.18
17
+
18
+ ## 0.1.23-next.17
19
+
20
+ ### Patch Changes
21
+
22
+ - fix
23
+ - Updated dependencies
24
+ - @granite-js/plugin-core@0.1.23-next.17
25
+ - @granite-js/style-utils@0.1.23-next.17
26
+ - @granite-js/lottie@0.1.23-next.17
27
+ - @granite-js/native@0.1.23-next.17
28
+ - @granite-js/image@0.1.23-next.17
29
+ - @granite-js/mpack@0.1.23-next.17
30
+ - @granite-js/jest@0.1.23-next.17
31
+ - @granite-js/cli@0.1.23-next.17
32
+
33
+ ## 0.1.23-next.16
34
+
35
+ ### Patch Changes
36
+
37
+ - update
38
+ - Updated dependencies
39
+ - @granite-js/plugin-core@0.1.23-next.16
40
+ - @granite-js/style-utils@0.1.23-next.16
41
+ - @granite-js/lottie@0.1.23-next.16
42
+ - @granite-js/native@0.1.23-next.16
43
+ - @granite-js/image@0.1.23-next.16
44
+ - @granite-js/mpack@0.1.23-next.16
45
+ - @granite-js/jest@0.1.23-next.16
46
+ - @granite-js/cli@0.1.23-next.16
47
+
3
48
  ## 0.1.23-next.15
4
49
 
5
50
  ### Patch Changes
@@ -25,9 +25,9 @@ __export(async_bridges_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(async_bridges_exports);
27
27
 
28
- // src/native-modules/natives/GraniteModule.brick.ts
28
+ // src/native-modules/natives/GraniteBrownfieldModule.brick.ts
29
29
  var import_brick_module = require("brick-module");
30
- var GraniteModule = import_brick_module.BrickModule.get("GraniteModule");
30
+ var GraniteModule = import_brick_module.BrickModule.get("GraniteBrownfieldModule");
31
31
 
32
32
  // src/native-modules/natives/closeView.ts
33
33
  async function closeView() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GraniteModule
3
- } from "./chunk-OWDLSIVX.mjs";
3
+ } from "./chunk-7GFSQK76.mjs";
4
4
 
5
5
  // src/native-modules/natives/closeView.ts
6
6
  async function closeView() {
@@ -0,0 +1,7 @@
1
+ // src/native-modules/natives/GraniteBrownfieldModule.brick.ts
2
+ import { BrickModule } from "brick-module";
3
+ var GraniteModule = BrickModule.get("GraniteBrownfieldModule");
4
+
5
+ export {
6
+ GraniteModule
7
+ };
@@ -24,9 +24,9 @@ __export(constant_bridges_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(constant_bridges_exports);
26
26
 
27
- // src/native-modules/natives/GraniteModule.brick.ts
27
+ // src/native-modules/natives/GraniteBrownfieldModule.brick.ts
28
28
  var import_brick_module = require("brick-module");
29
- var GraniteModule = import_brick_module.BrickModule.get("GraniteModule");
29
+ var GraniteModule = import_brick_module.BrickModule.get("GraniteBrownfieldModule");
30
30
 
31
31
  // src/native-modules/natives/getSchemeUri.ts
32
32
  function getSchemeUri() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GraniteModule
3
- } from "./chunk-OWDLSIVX.mjs";
3
+ } from "./chunk-7GFSQK76.mjs";
4
4
 
5
5
  // src/native-modules/natives/getSchemeUri.ts
6
6
  function getSchemeUri() {
@@ -0,0 +1,11 @@
1
+ import { BrickModuleSpec } from 'brick-module';
2
+ import { CodegenTypes } from 'react-native';
3
+ interface GraniteBrownfieldModuleSpec extends BrickModuleSpec {
4
+ readonly moduleName: 'GraniteBrownfieldModule';
5
+ readonly supportedEvents: ['visibilityChanged'];
6
+ onVisibilityChanged: CodegenTypes.EventEmitter<boolean>;
7
+ closeView(): Promise<void>;
8
+ schemeUri: string;
9
+ }
10
+ export declare const GraniteModule: GraniteBrownfieldModuleSpec;
11
+ export {};
@@ -0,0 +1 @@
1
+ export declare function setupPolyfills(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granite-js/react-native",
3
- "version": "0.1.23-next.15",
3
+ "version": "0.1.23-next.18",
4
4
  "description": "The Granite Framework",
5
5
  "bin": {
6
6
  "granite": "./bin/cli.js"
@@ -86,7 +86,7 @@
86
86
  "@babel/core": "^7.24.9",
87
87
  "@babel/preset-env": "^7.24.8",
88
88
  "@babel/preset-typescript": "^7.24.7",
89
- "@granite-js/native": "0.1.23-next.15",
89
+ "@granite-js/native": "0.1.23-next.18",
90
90
  "@testing-library/dom": "^10.4.0",
91
91
  "@testing-library/react": "^16.1.0",
92
92
  "@types/babel__core": "^7",
@@ -94,7 +94,7 @@
94
94
  "@types/node": "^22.10.2",
95
95
  "@types/react": "npm:19.1.0",
96
96
  "@vitest/coverage-v8": "^2.1.8",
97
- "brick-module": "^0.1.19",
97
+ "brick-module": "npm:0.2.1-next.1",
98
98
  "esbuild": "0.25.9",
99
99
  "eslint": "^9.7.0",
100
100
  "jsdom": "^25.0.1",
@@ -105,20 +105,20 @@
105
105
  "vitest": "^2.1.8"
106
106
  },
107
107
  "peerDependencies": {
108
- "@granite-js/native": "0.1.23-next.15",
108
+ "@granite-js/native": "0.1.23-next.18",
109
109
  "@types/react": "*",
110
110
  "brick-module": "*",
111
111
  "react": "*",
112
112
  "react-native": "*"
113
113
  },
114
114
  "dependencies": {
115
- "@granite-js/cli": "0.1.23-next.15",
116
- "@granite-js/image": "0.1.23-next.15",
117
- "@granite-js/jest": "0.1.23-next.15",
118
- "@granite-js/lottie": "0.1.23-next.15",
119
- "@granite-js/mpack": "0.1.23-next.15",
120
- "@granite-js/plugin-core": "0.1.23-next.15",
121
- "@granite-js/style-utils": "0.1.23-next.15",
115
+ "@granite-js/cli": "0.1.23-next.18",
116
+ "@granite-js/image": "0.1.23-next.18",
117
+ "@granite-js/jest": "0.1.23-next.18",
118
+ "@granite-js/lottie": "0.1.23-next.18",
119
+ "@granite-js/mpack": "0.1.23-next.18",
120
+ "@granite-js/plugin-core": "0.1.23-next.18",
121
+ "@granite-js/style-utils": "0.1.23-next.18",
122
122
  "es-toolkit": "^1.39.8",
123
123
  "react-native-url-polyfill": "1.3.0"
124
124
  }
@@ -0,0 +1,15 @@
1
+ import { BrickModule, BrickModuleSpec } from 'brick-module';
2
+ import { CodegenTypes } from 'react-native';
3
+
4
+ interface GraniteBrownfieldModuleSpec extends BrickModuleSpec {
5
+ readonly moduleName: 'GraniteBrownfieldModule';
6
+
7
+ readonly supportedEvents: ['visibilityChanged'];
8
+
9
+ onVisibilityChanged: CodegenTypes.EventEmitter<boolean>;
10
+
11
+ closeView(): Promise<void>;
12
+ schemeUri: string;
13
+ }
14
+
15
+ export const GraniteModule = BrickModule.get<GraniteBrownfieldModuleSpec>('GraniteBrownfieldModule');
@@ -1,4 +1,4 @@
1
- import { GraniteModule } from './GraniteModule.brick';
1
+ import { GraniteModule } from './GraniteBrownfieldModule.brick';
2
2
 
3
3
  /**
4
4
  * @public
@@ -1,4 +1,4 @@
1
- import { GraniteModule } from './GraniteModule.brick';
1
+ import { GraniteModule } from './GraniteBrownfieldModule.brick';
2
2
 
3
3
  /**
4
4
  * @public
@@ -1,5 +1,5 @@
1
1
  import { createContext, PropsWithChildren, ReactElement, useContext, useEffect, useState } from 'react';
2
- import { GraniteModule } from '../native-modules/natives/GraniteModule.brick';
2
+ import { GraniteModule } from '../native-modules/natives/GraniteBrownfieldModule.brick';
3
3
 
4
4
  const VisibilityChangedContext = createContext<boolean | undefined>(undefined);
5
5
 
@@ -31,9 +31,13 @@ export function VisibilityChangedProvider({
31
31
  const [visible, setVisible] = useState(isVisible);
32
32
 
33
33
  useEffect(() => {
34
- return GraniteModule.addEventListener('visibilityChanged', (nextVisible: boolean) => {
34
+ const subscription = GraniteModule.onVisibilityChanged((nextVisible: boolean) => {
35
35
  setVisible(nextVisible);
36
36
  });
37
+
38
+ return () => {
39
+ subscription.remove();
40
+ };
37
41
  }, []);
38
42
 
39
43
  return <VisibilityChangedContext.Provider value={visible}>{children}</VisibilityChangedContext.Provider>;
@@ -1,12 +0,0 @@
1
- import { BrickModule, BrickModuleSpec } from 'brick-module';
2
-
3
- interface GraniteModuleSpec extends BrickModuleSpec {
4
- readonly moduleName: 'GraniteModule';
5
-
6
- readonly supportedEvents: ['visibilityChanged'];
7
-
8
- closeView(): Promise<void>;
9
- schemeUri: string;
10
- }
11
-
12
- export const GraniteModule = BrickModule.get<GraniteModuleSpec>('GraniteModule');