@myop/react-native 0.0.1 → 0.0.3

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 CHANGED
@@ -1,122 +1,217 @@
1
- # @myop/react-native-host
1
+ # @myop/react-native
2
2
 
3
- A React Native library for embedding Myop components via WebView.
3
+ [![npm version](https://img.shields.io/npm/v/@myop/react-native.svg)](https://www.npmjs.com/package/@myop/react-native)
4
+ [![license](https://img.shields.io/npm/l/@myop/react-native.svg)](https://github.com/myop-dev/react-native/blob/main/LICENSE)
5
+
6
+ Embed [Myop](https://myop.dev) components in your React Native applications.
7
+
8
+ ## Features
9
+
10
+ - Load Myop components by ID or custom configuration
11
+ - Two-way communication between React Native and embedded components
12
+ - Customizable loading and fallback states
13
+ - Support for both V1 and V2 component formats
14
+ - TypeScript support
4
15
 
5
16
  ## Installation
6
17
 
7
18
  ```bash
8
- npm install @myop/react-native-host
19
+ npm install @myop/react-native
9
20
  ```
10
21
 
11
- ### Peer Dependencies
12
-
13
- Make sure you have the required peer dependencies installed:
22
+ Install the required peer dependency:
14
23
 
15
24
  ```bash
16
25
  npm install react-native-webview
17
26
  ```
18
27
 
19
- ## Usage
20
-
21
- ### Basic Usage with Component ID
28
+ ## Quick Start
22
29
 
23
30
  ```tsx
24
- import React from 'react';
25
- import { View } from 'react-native';
26
- import { MyopComponent } from '@myop/react-native-host';
31
+ import { MyopComponent } from '@myop/react-native';
27
32
 
28
33
  export default function App() {
29
34
  return (
30
- <View style={{ flex: 1 }}>
31
- <MyopComponent
32
- componentId="your-component-id"
33
- style={{ flex: 1 }}
34
- />
35
- </View>
35
+ <MyopComponent
36
+ componentId="your-component-id"
37
+ style={{ flex: 1 }}
38
+ />
36
39
  );
37
40
  }
38
41
  ```
39
42
 
40
- ### Usage with Component Config
43
+ ## Usage
44
+
45
+ ### Loading by Component ID
46
+
47
+ The simplest way to embed a Myop component:
48
+
49
+ ```tsx
50
+ <MyopComponent
51
+ componentId="abc123"
52
+ style={{ flex: 1 }}
53
+ />
54
+ ```
55
+
56
+ ### Passing Data to Components
57
+
58
+ Use the `data` prop to send data to your component's `myop_init_interface`:
41
59
 
42
60
  ```tsx
43
- import React from 'react';
44
- import { View } from 'react-native';
45
- import { MyopComponent, IComponentInstanceConfig } from '@myop/react-native-host';
61
+ const [userData, setUserData] = useState({ name: 'John', theme: 'dark' });
46
62
 
47
- export default function App() {
48
- const componentConfig: IComponentInstanceConfig = {
49
- id: 'component-instance-id',
50
- componentId: 'your-component-id',
51
- componentName: 'MyComponent',
52
- skinSelector: {
53
- // your skin selector config
63
+ <MyopComponent
64
+ componentId="abc123"
65
+ data={userData}
66
+ style={{ flex: 1 }}
67
+ />
68
+ ```
69
+
70
+ When `data` changes, `myop_init_interface` is automatically called with the new value.
71
+
72
+ ### Handling Component Events
73
+
74
+ Listen for events from your component's `myop_cta_handler`:
75
+
76
+ ```tsx
77
+ <MyopComponent
78
+ componentId="abc123"
79
+ on={(action, payload) => {
80
+ switch (action) {
81
+ case 'submit':
82
+ handleSubmit(payload);
83
+ break;
84
+ case 'navigate':
85
+ navigation.navigate(payload.screen);
86
+ break;
54
87
  }
55
- };
88
+ }}
89
+ style={{ flex: 1 }}
90
+ />
91
+ ```
56
92
 
57
- return (
58
- <View style={{ flex: 1 }}>
59
- <MyopComponent
60
- componentConfig={componentConfig}
61
- style={{ flex: 1 }}
62
- />
63
- </View>
64
- );
65
- }
93
+ ### Executing Commands
94
+
95
+ Access the component instance for direct command execution:
96
+
97
+ ```tsx
98
+ const [component, setComponent] = useState(null);
99
+
100
+ <MyopComponent
101
+ componentId="abc123"
102
+ onLoad={(instance) => setComponent(() => instance)}
103
+ style={{ flex: 1 }}
104
+ />
105
+
106
+ // Execute commands on the component
107
+ const handleReset = () => {
108
+ component?.('.reset()');
109
+ };
66
110
  ```
67
111
 
68
- ### With onLoad Callback
112
+ ### Custom Loading State
69
113
 
70
- The `onLoad` callback gives you access to the component instance after it loads, allowing you to execute commands:
114
+ Provide your own loading component:
71
115
 
72
116
  ```tsx
73
- import React from 'react';
74
- import { View, Button } from 'react-native';
75
- import { MyopComponent } from '@myop/react-native-host';
117
+ import { ActivityIndicator, View } from 'react-native';
76
118
 
77
- export default function App() {
78
- const [myopInstance, setMyopInstance] = React.useState(null);
119
+ <MyopComponent
120
+ componentId="abc123"
121
+ loader={
122
+ <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
123
+ <ActivityIndicator size="large" color="#0000ff" />
124
+ </View>
125
+ }
126
+ fadeDuration={300}
127
+ style={{ flex: 1 }}
128
+ />
129
+ ```
79
130
 
80
- const handleLoad = (myopComponent) => {
81
- setMyopInstance(() => myopComponent);
82
- console.log('Myop component loaded!');
83
- };
131
+ Set `loader={null}` to disable the loading state entirely.
84
132
 
85
- const executeCommand = () => {
86
- if (myopInstance) {
87
- myopInstance('.someMethod()');
88
- }
89
- };
133
+ ### Custom Fallback State
90
134
 
91
- return (
92
- <View style={{ flex: 1 }}>
93
- <MyopComponent
94
- componentId="your-component-id"
95
- onLoad={handleLoad}
96
- style={{ flex: 1 }}
97
- />
98
- <Button title="Execute Command" onPress={executeCommand} />
135
+ Display a custom view when the component fails to load:
136
+
137
+ ```tsx
138
+ <MyopComponent
139
+ componentId="abc123"
140
+ fallback={
141
+ <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
142
+ <Text>Unable to load component</Text>
99
143
  </View>
100
- );
101
- }
144
+ }
145
+ onError={(error) => console.error('Load failed:', error)}
146
+ style={{ flex: 1 }}
147
+ />
148
+ ```
149
+
150
+ ### Using Component Configuration
151
+
152
+ For advanced use cases, pass a full configuration object:
153
+
154
+ ```tsx
155
+ import { MyopComponent, IComponentInstanceConfig } from '@myop/react-native';
156
+
157
+ const config: IComponentInstanceConfig = {
158
+ id: 'instance-1',
159
+ componentId: 'abc123',
160
+ componentName: 'MyComponent',
161
+ skinSelector: {
162
+ type: 'Dedicated',
163
+ skin: { id: 'skin-1' }
164
+ }
165
+ };
166
+
167
+ <MyopComponent
168
+ componentConfig={config}
169
+ style={{ flex: 1 }}
170
+ />
102
171
  ```
103
172
 
104
- ## API
173
+ ### Environment Selection
105
174
 
106
- ### Props
175
+ Target different deployment environments:
107
176
 
108
- | Prop | Type | Required | Description |
109
- |------|------|----------|-------------|
110
- | `componentId` | `string` | No* | The ID of the component to load from Myop cloud |
111
- | `componentConfig` | `IComponentInstanceConfig` | No* | The complete component configuration object |
112
- | `style` | `StyleProp<ViewStyle>` | No | Custom styles for the component container |
113
- | `onLoad` | `(myopComponent: (command: string) => void) => void` | No | Callback fired when component loads, receives command executor function |
177
+ ```tsx
178
+ <MyopComponent
179
+ componentId="abc123"
180
+ environment="staging" // defaults to "production"
181
+ style={{ flex: 1 }}
182
+ />
183
+ ```
114
184
 
115
- \* Either `componentId` or `componentConfig` must be provided
185
+ ## API Reference
116
186
 
117
- ### Types
187
+ ### MyopComponent Props
188
+
189
+ | Prop | Type | Default | Description |
190
+ |------|------|---------|-------------|
191
+ | `componentId` | `string` | - | Component ID to load from Myop cloud |
192
+ | `componentConfig` | `IComponentInstanceConfig` | - | Full component configuration object |
193
+ | `data` | `any` | - | Data passed to `myop_init_interface` |
194
+ | `on` | `(action: string, payload?: any) => void` | - | Handler for `myop_cta_handler` events |
195
+ | `onLoad` | `(instance: (cmd: string) => void) => void` | - | Callback when component loads |
196
+ | `onError` | `(error: string) => void` | - | Callback when component fails to load |
197
+ | `loader` | `ReactNode` | `<MyopLoader />` | Custom loading component |
198
+ | `fallback` | `ReactNode` | `<MyopFallback />` | Custom fallback component |
199
+ | `fadeDuration` | `number` | `200` | Loader fade-out duration in ms |
200
+ | `environment` | `string` | `"production"` | Target environment |
201
+ | `v1Mode` | `boolean` | `false` | Use V1 component format |
202
+ | `style` | `StyleProp<ViewStyle>` | - | Container styles |
118
203
 
119
- #### IComponentInstanceConfig
204
+ Either `componentId` or `componentConfig` must be provided.
205
+
206
+ ### Exported Components
207
+
208
+ | Component | Description |
209
+ |-----------|-------------|
210
+ | `MyopComponent` | Main component for embedding Myop content |
211
+ | `MyopLoader` | Default animated loading state |
212
+ | `MyopFallback` | Default error/fallback state |
213
+
214
+ ### Types
120
215
 
121
216
  ```typescript
122
217
  interface IComponentInstanceConfig {
@@ -129,38 +224,24 @@ interface IComponentInstanceConfig {
129
224
  resolvedNestedComponents?: IComponentConfig[];
130
225
  [key: string]: any;
131
226
  }
132
- ```
133
-
134
- ## How it Works
135
227
 
136
- The component uses a WebView to load and render Myop components. It:
137
-
138
- 1. Loads the Myop SDK from the CDN
139
- 2. Fetches the component configuration (if using `componentId`)
140
- 3. Initializes the component inside the WebView
141
- 4. Provides a bridge to execute commands on the loaded component
228
+ interface MyopLoaderRef {
229
+ fadeOut: (duration?: number) => void;
230
+ }
231
+ ```
142
232
 
143
233
  ## Requirements
144
234
 
145
- - React Native 0.60.0 or higher
146
- - React 16.8.0 or higher
147
- - react-native-webview 13.0.0 or higher
148
-
149
- ## Development
150
-
151
- This project includes a demo Expo app for testing. To run the development app:
152
-
153
- ```bash
154
- npm install
155
- npx expo start
156
- ```
235
+ | Dependency | Version |
236
+ |------------|---------|
237
+ | React | >= 16.8.0 |
238
+ | React Native | >= 0.60.0 |
239
+ | react-native-webview | >= 11.0.0 |
157
240
 
158
- ## Building the Library
241
+ ## Contributing
159
242
 
160
- ```bash
161
- npm run build
162
- ```
243
+ Contributions are welcome. Please open an issue to discuss proposed changes before submitting a pull request.
163
244
 
164
245
  ## License
165
246
 
166
- MIT
247
+ MIT
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
3
  import type { IComponentInstanceConfig } from './types';
4
4
  interface IPropTypes {
@@ -6,6 +6,14 @@ interface IPropTypes {
6
6
  componentId?: string;
7
7
  componentConfig?: IComponentInstanceConfig;
8
8
  onLoad?: (myopComponent: (command: string) => void) => void;
9
+ onError?: (error: string) => void;
10
+ on?: (action: string, payload?: any) => void;
11
+ data?: any;
12
+ loader?: ReactNode;
13
+ fallback?: ReactNode;
14
+ fadeDuration?: number;
15
+ v1Mode?: boolean;
16
+ environment?: string;
9
17
  }
10
18
  export declare const MyopComponent: (props: IPropTypes) => React.JSX.Element;
11
19
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"MyopComponent.d.ts","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAG/C,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,SAAS,CAAC;AAGtD,UAAU,UAAU;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;CAC/D;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,UAAU,sBAqE9C,CAAA"}
1
+ {"version":3,"file":"MyopComponent.d.ts","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmB,SAAS,EAAuD,MAAM,OAAO,CAAC;AAG/G,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,SAAS,CAAC;AAMtD,UAAU,UAAU;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IAC5D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,UAAU,sBA8N9C,CAAA"}
@@ -37,66 +37,214 @@ exports.MyopComponent = void 0;
37
37
  const react_1 = __importStar(require("react"));
38
38
  const react_native_1 = require("react-native");
39
39
  const react_native_webview_1 = require("react-native-webview");
40
- const componentHost_html_1 = require("./componentHost.html");
40
+ const componentHost_html_js_1 = require("./componentHost.html.js");
41
+ const MyopLoader_1 = require("./MyopLoader");
42
+ const MyopFallback_1 = require("./MyopFallback");
41
43
  const MyopComponent = (props) => {
44
+ var _a, _b;
42
45
  const webviewRef = (0, react_1.useRef)(null);
46
+ const loaderRef = (0, react_1.useRef)(null);
47
+ const [showLoader, setShowLoader] = (0, react_1.useState)(true);
48
+ const [showFallback, setShowFallback] = (0, react_1.useState)(false);
49
+ const [isComponentLoaded, setIsComponentLoaded] = (0, react_1.useState)(false);
50
+ const fadeDuration = (_a = props.fadeDuration) !== null && _a !== void 0 ? _a : 200;
51
+ // Function to call myop_init_interface in the WebView
52
+ const callInitInterface = (0, react_1.useCallback)((data) => {
53
+ if (!webviewRef.current || !isComponentLoaded)
54
+ return;
55
+ const encoded = encodeURIComponent(JSON.stringify(data));
56
+ webviewRef.current.injectJavaScript(`
57
+ if (window.myopComponent && window.myopComponent.element && window.myopComponent.element.contentWindow && window.myopComponent.element.contentWindow.myop_init_interface) {
58
+ window.myopComponent.element.contentWindow.myop_init_interface(JSON.parse(decodeURIComponent('${encoded}')));
59
+ }
60
+ true;
61
+ `);
62
+ }, [isComponentLoaded]);
63
+ // Call myop_init_interface when data prop changes (after component is loaded)
64
+ (0, react_1.useEffect)(() => {
65
+ if (isComponentLoaded && props.data !== undefined) {
66
+ callInitInterface(props.data);
67
+ }
68
+ }, [props.data, isComponentLoaded, callInitInterface]);
69
+ const hideLoader = (0, react_1.useCallback)(() => {
70
+ var _a;
71
+ if ((_a = loaderRef.current) === null || _a === void 0 ? void 0 : _a.fadeOut) {
72
+ loaderRef.current.fadeOut(fadeDuration);
73
+ setTimeout(() => {
74
+ setShowLoader(false);
75
+ }, fadeDuration);
76
+ }
77
+ else {
78
+ setShowLoader(false);
79
+ }
80
+ }, [fadeDuration]);
43
81
  const myopComponent = (command) => {
44
82
  var _a;
45
- //TODO : return promise to data?
46
83
  (_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
47
84
  window.myopComponent${command}
48
85
  `);
49
86
  };
50
- const onMessage = (event) => {
51
- if (event.nativeEvent.data === 'COMPONENT_LOADED') {
52
- if (props.onLoad) {
53
- props.onLoad(myopComponent);
54
- }
55
- // webviewRef.current?.injectJavaScript(`
56
- // window.myopComponent.props.showPopupWOW();
57
- // `);
87
+ const handleError = (0, react_1.useCallback)((errorMsg) => {
88
+ console.error('[MyopComponent] Error:', errorMsg);
89
+ hideLoader();
90
+ setShowFallback(true);
91
+ if (props.onError) {
92
+ props.onError(errorMsg);
58
93
  }
59
- // Alert.alert('Received from WebView', event.nativeEvent.data);
60
- };
61
- const fetchFromReactNative = async () => {
62
- var _a;
94
+ }, [hideLoader, props.onError]);
95
+ const loadComponent = (0, react_1.useCallback)(async () => {
96
+ var _a, _b, _c;
63
97
  try {
64
98
  let componentConfig = null;
65
99
  if (props.componentConfig) {
66
100
  componentConfig = props.componentConfig;
67
101
  }
68
102
  else if (props.componentId) {
69
- const res = await fetch(`https://cloud.myop.dev/flow?id=${props.componentId}&auto=true`);
70
- componentConfig = await res.json();
71
- componentConfig = componentConfig.item.components[0];
103
+ if (props.v1Mode) {
104
+ // V1 mode: use flow endpoint
105
+ const res = await fetch(`https://cloud.myop.dev/flow?id=${props.componentId}&auto=true`);
106
+ const json = await res.json();
107
+ if (!((_b = (_a = json.item) === null || _a === void 0 ? void 0 : _a.components) === null || _b === void 0 ? void 0 : _b[0])) {
108
+ handleError(`Component "${props.componentId}" not found`);
109
+ return;
110
+ }
111
+ componentConfig = json.item.components[0];
112
+ }
113
+ else {
114
+ // V2 mode (default): use consume endpoint
115
+ const env = props.environment || 'production';
116
+ const res = await fetch(`https://cloud.myop.dev/consume?id=${props.componentId}&env=${env}`);
117
+ const config = await res.json();
118
+ const variant = config.item;
119
+ if (!variant) {
120
+ handleError(`Component "${props.componentId}" not found`);
121
+ return;
122
+ }
123
+ if (!variant.consume_variant || !variant.consume_variant.length) {
124
+ handleError(`Component "${props.componentId}" has no implementation for environment "${env}"`);
125
+ return;
126
+ }
127
+ // Build V2 component config
128
+ componentConfig = {
129
+ instance: {
130
+ id: 'auto',
131
+ componentId: variant.componentId,
132
+ componentName: variant.name,
133
+ skinSelector: {
134
+ type: 'Dedicated',
135
+ skin: { id: 'skin_auto_v2_converted' }
136
+ }
137
+ },
138
+ type: {
139
+ id: variant.id,
140
+ name: variant.name,
141
+ description: variant.description,
142
+ props: [
143
+ {
144
+ id: 'in_auto_v2_converted',
145
+ name: 'myop_init_interface',
146
+ type: 'any',
147
+ behavior: { type: 'code' }
148
+ },
149
+ {
150
+ id: 'out_auto_v2_converted',
151
+ name: 'myop_cta_handler',
152
+ type: 'any',
153
+ behavior: { type: 'code' }
154
+ }
155
+ ],
156
+ refs: [],
157
+ skins: [{
158
+ id: 'skin_auto_v2_converted',
159
+ name: 'auto_v2_converted',
160
+ description: '',
161
+ loader: variant.consume_variant[0].loader
162
+ }],
163
+ defaultSkin: 0
164
+ },
165
+ name: variant.name
166
+ };
167
+ }
168
+ }
169
+ if (!componentConfig) {
170
+ handleError('No component configuration provided');
171
+ return;
72
172
  }
73
173
  const encoded = encodeURIComponent(JSON.stringify(componentConfig));
74
- //send it into the webview
75
- (_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
174
+ (_c = webviewRef.current) === null || _c === void 0 ? void 0 : _c.injectJavaScript(`
76
175
  loadMyopComponent(\`${encoded}\`);
176
+ true;
77
177
  `);
78
178
  }
79
179
  catch (err) {
80
- console.error('Fetch failed:', err);
180
+ handleError((err === null || err === void 0 ? void 0 : err.message) || 'Unknown error');
81
181
  }
82
- };
83
- (0, react_1.useEffect)(() => {
84
- if (webviewRef.current)
85
- fetchFromReactNative().then();
86
- }, [webviewRef]);
182
+ }, [props.componentConfig, props.componentId, props.v1Mode, props.environment, handleError]);
183
+ const onMessage = (0, react_1.useCallback)((event) => {
184
+ var _a, _b, _c, _d;
185
+ const message = event.nativeEvent.data;
186
+ console.log('[MyopComponent] Message from WebView:', message);
187
+ if (message === 'WEBVIEW_READY') {
188
+ // WebView is ready, now inject the component loading code
189
+ loadComponent();
190
+ }
191
+ else if (message === 'COMPONENT_LOADED') {
192
+ setIsComponentLoaded(true);
193
+ hideLoader();
194
+ // Call myop_init_interface immediately with initial data if provided
195
+ if (props.data !== undefined) {
196
+ const encoded = encodeURIComponent(JSON.stringify(props.data));
197
+ (_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
198
+ if (window.myopComponent && window.myopComponent.element && window.myopComponent.element.contentWindow && window.myopComponent.element.contentWindow.myop_init_interface) {
199
+ window.myopComponent.element.contentWindow.myop_init_interface(JSON.parse(decodeURIComponent('${encoded}')));
200
+ }
201
+ true;
202
+ `);
203
+ }
204
+ if (props.onLoad) {
205
+ props.onLoad(myopComponent);
206
+ }
207
+ }
208
+ else if (((_b = message === null || message === void 0 ? void 0 : message.startsWith) === null || _b === void 0 ? void 0 : _b.call(message, 'COMPONENT_ERROR:')) || ((_c = message === null || message === void 0 ? void 0 : message.startsWith) === null || _c === void 0 ? void 0 : _c.call(message, 'SDK_INIT_ERROR:'))) {
209
+ const errorMsg = message.replace('COMPONENT_ERROR:', '').replace('SDK_INIT_ERROR:', '');
210
+ console.error('[MyopComponent] Error loading component:', errorMsg);
211
+ hideLoader();
212
+ setShowFallback(true);
213
+ if (props.onError) {
214
+ props.onError(errorMsg);
215
+ }
216
+ }
217
+ else if ((_d = message === null || message === void 0 ? void 0 : message.startsWith) === null || _d === void 0 ? void 0 : _d.call(message, 'CTA:')) {
218
+ // Handle myop_cta_handler calls
219
+ try {
220
+ const ctaData = JSON.parse(message.substring(4));
221
+ if (props.on) {
222
+ props.on(ctaData.action, ctaData.payload);
223
+ }
224
+ }
225
+ catch (e) {
226
+ console.error('[MyopComponent] Failed to parse CTA message:', e);
227
+ }
228
+ }
229
+ }, [loadComponent, props.onLoad, props.onError, props.on, hideLoader]);
87
230
  return (react_1.default.createElement(react_native_1.View, { style: props.style ? props.style : styles.root },
88
- react_1.default.createElement(react_native_webview_1.WebView, { ref: webviewRef, originWhitelist: ['*'], source: { html: componentHost_html_1.HTML }, onMessage: onMessage, style: styles.webview, javaScriptEnabled: true, domStorageEnabled: true, mixedContentMode: "always" // allows HTTPS + HTTP content
89
- , allowFileAccess: true, allowUniversalAccessFromFileURLs: true })));
231
+ react_1.default.createElement(react_native_webview_1.WebView, { ref: webviewRef, originWhitelist: ['*'], source: { html: componentHost_html_js_1.HTML }, onMessage: onMessage, style: styles.webview, javaScriptEnabled: true, domStorageEnabled: true, mixedContentMode: "always", allowFileAccess: true, allowUniversalAccessFromFileURLs: true }),
232
+ showLoader && (react_1.default.createElement(react_native_1.View, { style: styles.loaderContainer }, props.loader !== undefined
233
+ ? ((0, react_1.isValidElement)(props.loader)
234
+ ? (0, react_1.cloneElement)(props.loader, { ref: loaderRef })
235
+ : props.loader)
236
+ : react_1.default.createElement(MyopLoader_1.MyopLoader, { ref: loaderRef }))),
237
+ showFallback && (react_1.default.createElement(react_native_1.View, { style: styles.loaderContainer }, (_b = props.fallback) !== null && _b !== void 0 ? _b : react_1.default.createElement(MyopFallback_1.MyopFallback, null)))));
90
238
  };
91
239
  exports.MyopComponent = MyopComponent;
92
240
  const styles = react_native_1.StyleSheet.create({
93
241
  root: {
94
- flex: 1,
95
- // backgroundColor: 'red', // visible background
242
+ width: '100%',
243
+ height: '100%',
96
244
  },
97
245
  webview: {
98
246
  flex: 1,
99
- //backgroundColor: 'blue', // visible background behind HTML
100
- }
247
+ },
248
+ loaderContainer: Object.assign(Object.assign({}, react_native_1.StyleSheet.absoluteFillObject), { zIndex: 1 }),
101
249
  });
102
250
  //# sourceMappingURL=MyopComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MyopComponent.js","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+C;AAC/C,+CAA8C;AAC9C,+DAA6C;AAG7C,6DAA0C;AASnC,MAAM,aAAa,GAAG,CAAC,KAAiB,EAAE,EAAE;IAC/C,MAAM,UAAU,GAAG,IAAA,cAAM,EAAU,IAAI,CAAC,CAAC;IAEzC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,EAAE;;QACvC,gCAAgC;QAC/B,MAAA,UAAU,CAAC,OAAO,0CAAE,gBAAgB,CAAC;sCACP,OAAO;cAC/B,CAAC,CAAC;IACZ,CAAC,CAAA;IAED,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE;QAC7B,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YAChD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBACf,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAChC,CAAC;YACD,yCAAyC;YACzC,iDAAiD;YACjD,OAAO;QACX,CAAC;QACD,iEAAiE;IACrE,CAAC,CAAC;IAGF,MAAM,oBAAoB,GAAG,KAAK,IAAI,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AAC,CAAA;AA9NY,QAAA,aAAa,iBA8NzB;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE;QACF,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACjB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,CAAC;KACV;IACD,eAAe,kCACR,yBAAU,CAAC,kBAAkB,KAChC,MAAM,EAAE,CAAC,GACZ;CACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const MyopFallback: () => React.JSX.Element;
3
+ //# sourceMappingURL=MyopFallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MyopFallback.d.ts","sourceRoot":"","sources":["../src/MyopFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA8D1B,eAAO,MAAM,YAAY,yBAWxB,CAAC"}