rn-erxes-sdk 0.3.3 → 0.4.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.
@@ -0,0 +1,229 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import { Platform } from 'react-native';
3
+ import { ErxesNativeIOS } from './nativeIos';
4
+
5
+ /**
6
+ * The identified end user. Same shape the native bridge expects — passing
7
+ * `undefined` leaves the visitor anonymous until you call `setUser` later.
8
+ */
9
+
10
+ /**
11
+ * Helpers handed to action `onPress` callbacks (and `onAction`) so you can drive
12
+ * the messenger imperatively from inside a tap handler — show/hide it, toggle the
13
+ * launcher, or swap the user.
14
+ */
15
+
16
+ /**
17
+ * A chat-mode action rendered in the header (`homeActions`) or drawer
18
+ * (`drawerActions`). Only `id`/`title`/`systemIcon` cross the native bridge; the
19
+ * `onPress` callback stays in JS and runs when the matching action is tapped.
20
+ */
21
+
22
+ /**
23
+ * Drop `onPress` so only the data-only fields the native bridge understands
24
+ * (`id`/`title`/`systemIcon`) cross over. React Native cannot send JS functions
25
+ * to native, so `onPress` is dispatched on the JS side via the action listener.
26
+ */
27
+ function stripActions(actions) {
28
+ return actions.map(_ref => {
29
+ let {
30
+ onPress: _onPress,
31
+ ...nativeAction
32
+ } = _ref;
33
+ return nativeAction;
34
+ });
35
+ }
36
+
37
+ /**
38
+ * Declarative wrapper around {@link ErxesNativeIOS}. Configures the native erxes
39
+ * messenger, wires up action taps, and manages the show/hide lifecycle so app
40
+ * code stays a single component. Renders nothing — the messenger UI is presented
41
+ * natively over your app.
42
+ *
43
+ * For advanced/imperative control, use `ErxesNativeIOS` directly.
44
+ */
45
+ export function ErxesMessenger(_ref2) {
46
+ let {
47
+ integrationId,
48
+ endpoint,
49
+ serverUrl,
50
+ subDomain,
51
+ displayMode = 'classic',
52
+ user,
53
+ cachedCustomerId,
54
+ primaryColor,
55
+ visible,
56
+ autoOpen = displayMode === 'chat',
57
+ autoHideOnUnmount = true,
58
+ launcherVisible,
59
+ homeActions = [],
60
+ drawerActions = [],
61
+ renderLoading,
62
+ onLoad,
63
+ onReady,
64
+ onOpen,
65
+ onClose,
66
+ onError,
67
+ onAction,
68
+ onLoadingChange
69
+ } = _ref2;
70
+ // Keep the latest actions/callback in refs so the action listener (registered
71
+ // once below) always dispatches against current props without re-subscribing.
72
+ const actionsRef = useRef([]);
73
+ const onActionRef = useRef(onAction);
74
+ const onLoadingChangeRef = useRef(onLoadingChange);
75
+ // Tracks whether we believe the messenger is currently presented, so we never
76
+ // double-present (chat mode auto-presents inside `configure()`) or fire a
77
+ // redundant show/hide. Native gives us no presentation callback, so this is our
78
+ // best-effort intent mirror.
79
+ const shownRef = useRef(false);
80
+
81
+ // Flips true only after native `configure()` resolves. The controlled-`visible`
82
+ // effect gates on this so it never calls `showMessenger()` before `configure()`
83
+ // (the native SDK asserts on that ordering).
84
+ const [configured, setConfigured] = useState(false);
85
+ // True while configuring (between `onLoad` and `onReady`/`onError`); drives
86
+ // `renderLoading`.
87
+ const [loading, setLoading] = useState(false);
88
+ useEffect(() => {
89
+ onLoadingChangeRef.current = onLoadingChange;
90
+ }, [onLoadingChange]);
91
+ useEffect(() => {
92
+ var _onLoadingChangeRef$c;
93
+ (_onLoadingChangeRef$c = onLoadingChangeRef.current) === null || _onLoadingChangeRef$c === void 0 ? void 0 : _onLoadingChangeRef$c.call(onLoadingChangeRef, loading);
94
+ }, [loading]);
95
+ useEffect(() => {
96
+ actionsRef.current = [...homeActions, ...drawerActions];
97
+ onActionRef.current = onAction;
98
+ }, [homeActions, drawerActions, onAction]);
99
+ useEffect(() => {
100
+ if (Platform.OS !== 'ios') {
101
+ return;
102
+ }
103
+ setConfigured(false);
104
+ const helpers = {
105
+ show: async () => {
106
+ await ErxesNativeIOS.showMessenger();
107
+ shownRef.current = true;
108
+ },
109
+ hide: async () => {
110
+ await ErxesNativeIOS.hideMessenger();
111
+ shownRef.current = false;
112
+ },
113
+ showLauncher: () => ErxesNativeIOS.showLauncher(),
114
+ hideLauncher: () => ErxesNativeIOS.hideLauncher(),
115
+ setUser: nextUser => ErxesNativeIOS.setUser(nextUser),
116
+ clearUser: () => ErxesNativeIOS.clearUser()
117
+ };
118
+ const sub = ErxesNativeIOS.addActionListener(async id => {
119
+ var _onActionRef$current;
120
+ const action = actionsRef.current.find(item => item.id === id);
121
+ if (action !== null && action !== void 0 && action.onPress) {
122
+ await action.onPress(helpers);
123
+ return;
124
+ }
125
+ await ((_onActionRef$current = onActionRef.current) === null || _onActionRef$current === void 0 ? void 0 : _onActionRef$current.call(onActionRef, id, helpers));
126
+ });
127
+
128
+ // Connection complete (native `MessengerSDK.isReady`): the messenger is
129
+ // truly ready, so end the loading state and notify the host.
130
+ const readySub = ErxesNativeIOS.addReadyListener(() => {
131
+ setLoading(false);
132
+ onReady === null || onReady === void 0 ? void 0 : onReady();
133
+ });
134
+ async function setup() {
135
+ try {
136
+ setLoading(true);
137
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad();
138
+ if (user) {
139
+ await ErxesNativeIOS.setUser(user);
140
+ }
141
+ await ErxesNativeIOS.configure({
142
+ integrationId,
143
+ endpoint,
144
+ serverUrl,
145
+ subDomain,
146
+ cachedCustomerId,
147
+ displayMode,
148
+ primaryColor,
149
+ homeActions: stripActions(homeActions),
150
+ drawerActions: stripActions(drawerActions)
151
+ });
152
+
153
+ // `configure()` only kicks off the async connect; `onReady` and the end
154
+ // of `loading` are driven by the ready listener above, not here.
155
+
156
+ // Decide the initial open state. If `visible` is controlled it wins;
157
+ // otherwise fall back to `autoOpen` (defaults to true in chat mode).
158
+ const shouldOpen = visible ?? autoOpen;
159
+ if (displayMode === 'chat') {
160
+ // Chat mode auto-presents itself inside `configure()` — never call
161
+ // `showMessenger()` for the initial open or we'd present a second one.
162
+ if (shouldOpen) {
163
+ shownRef.current = true;
164
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
165
+ } else {
166
+ // Caller wants it closed: undo the native auto-present.
167
+ await ErxesNativeIOS.hideMessenger();
168
+ shownRef.current = false;
169
+ }
170
+ } else {
171
+ // Classic mode: configure does not open anything. Show the launcher
172
+ // and/or present the sheet explicitly.
173
+ if (launcherVisible === true) {
174
+ await ErxesNativeIOS.showLauncher();
175
+ } else if (launcherVisible === false) {
176
+ await ErxesNativeIOS.hideLauncher();
177
+ }
178
+ if (shouldOpen) {
179
+ await ErxesNativeIOS.showMessenger();
180
+ shownRef.current = true;
181
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
182
+ }
183
+ }
184
+ setConfigured(true);
185
+ } catch (error) {
186
+ // Setup failed before the connection could complete — end loading here
187
+ // since the ready listener will never fire.
188
+ setLoading(false);
189
+ onError === null || onError === void 0 ? void 0 : onError(error);
190
+ }
191
+ }
192
+ setup();
193
+ return () => {
194
+ sub.remove();
195
+ readySub.remove();
196
+ if (autoHideOnUnmount && shownRef.current) {
197
+ ErxesNativeIOS.hideMessenger();
198
+ shownRef.current = false;
199
+ onClose === null || onClose === void 0 ? void 0 : onClose();
200
+ }
201
+ };
202
+ // Re-run setup only when the native config identity changes; callbacks and
203
+ // actions are read through refs so they don't need to be deps here.
204
+ // eslint-disable-next-line react-hooks/exhaustive-deps
205
+ }, [integrationId, endpoint, serverUrl, subDomain, displayMode]);
206
+ useEffect(() => {
207
+ // Wait until `configure()` has resolved — otherwise `showMessenger()` would
208
+ // race ahead of it and trip the native configure-before-show assertion. The
209
+ // initial open is handled in `setup()`; this only reacts to later changes.
210
+ if (Platform.OS !== 'ios' || visible === undefined || !configured) {
211
+ return;
212
+ }
213
+ if (visible && !shownRef.current) {
214
+ ErxesNativeIOS.showMessenger();
215
+ shownRef.current = true;
216
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
217
+ } else if (!visible && shownRef.current) {
218
+ ErxesNativeIOS.hideMessenger();
219
+ shownRef.current = false;
220
+ onClose === null || onClose === void 0 ? void 0 : onClose();
221
+ }
222
+ // eslint-disable-next-line react-hooks/exhaustive-deps
223
+ }, [visible, configured]);
224
+ if (loading && renderLoading) {
225
+ return renderLoading();
226
+ }
227
+ return null;
228
+ }
229
+ //# sourceMappingURL=ErxesMessenger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useRef","useState","Platform","ErxesNativeIOS","stripActions","actions","map","_ref","onPress","_onPress","nativeAction","ErxesMessenger","_ref2","integrationId","endpoint","serverUrl","subDomain","displayMode","user","cachedCustomerId","primaryColor","visible","autoOpen","autoHideOnUnmount","launcherVisible","homeActions","drawerActions","renderLoading","onLoad","onReady","onOpen","onClose","onError","onAction","onLoadingChange","actionsRef","onActionRef","onLoadingChangeRef","shownRef","configured","setConfigured","loading","setLoading","current","_onLoadingChangeRef$c","call","OS","helpers","show","showMessenger","hide","hideMessenger","showLauncher","hideLauncher","setUser","nextUser","clearUser","sub","addActionListener","id","_onActionRef$current","action","find","item","readySub","addReadyListener","setup","configure","shouldOpen","error","remove","undefined"],"sourceRoot":"../../src","sources":["ErxesMessenger.tsx"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAwB,OAAO;AACnE,SAASC,QAAQ,QAAQ,cAAc;AAEvC,SAASC,cAAc,QAA4B,aAAa;;AAEhE;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;;AA0EA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAACC,OAAsB,EAAE;EAC5C,OAAOA,OAAO,CAACC,GAAG,CAACC,IAAA;IAAA,IAAC;MAAEC,OAAO,EAAEC,QAAQ;MAAE,GAAGC;IAAa,CAAC,GAAAH,IAAA;IAAA,OAAKG,YAAY;EAAA,EAAC;AAC9E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAAC,KAAA,EAuBN;EAAA,IAvBO;IAC7BC,aAAa;IACbC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,WAAW,GAAG,SAAS;IACvBC,IAAI;IACJC,gBAAg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AAPA,OAAO,uBAAPA,OAAO,CAAG,CAAC;IACb;IACA;EACF,CAAC,EAAE,CAACV,OAAO,EAAEkB,UAAU,CAAC,CAAC;EAEzB,IAAIE,OAAO,IAAId,aAAa,EAAE;IAC5B,OAAOA,aAAa,CAAC,CAAC;EACxB;EAEA,OAAO,IAAI;AACb"}
@@ -1,2 +1,3 @@
1
1
  export { ErxesNativeIOS } from './nativeIos';
2
+ export { ErxesMessenger } from './ErxesMessenger';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ErxesNativeIOS"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa"}
1
+ {"version":3,"names":["ErxesNativeIOS","ErxesMessenger"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa;AAO5C,SAASC,cAAc,QAAQ,kBAAkB"}
@@ -8,6 +8,9 @@ import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
8
8
 
9
9
  /** Native event name emitted when a chat-mode action is tapped. */
10
10
  const ACTION_EVENT = 'onErxesAction';
11
+
12
+ /** Native event name emitted when the connect handshake completes. */
13
+ const READY_EVENT = 'onErxesReady';
11
14
  const LINKING_ERROR = "The rn-erxes-sdk native iOS module is not linked. Run `pod install` in your app's ios directory and rebuild the app.";
12
15
  const nativeModule = NativeModules.RnErxesSdk;
13
16
  function getNativeModule() {
@@ -60,6 +63,16 @@ export const ErxesNativeIOS = {
60
63
  addActionListener(handler) {
61
64
  const emitter = new NativeEventEmitter(getNativeModule());
62
65
  return emitter.addListener(ACTION_EVENT, event => handler(event.id));
66
+ },
67
+ /**
68
+ * Listen for the connect handshake completing — i.e. the messenger is ready
69
+ * (`MessengerSDK.isReady`). Fires once per connection; if already connected
70
+ * when you subscribe via a fresh `configure`, it fires again. Returns a
71
+ * subscription — call `.remove()` to stop listening.
72
+ */
73
+ addReadyListener(handler) {
74
+ const emitter = new NativeEventEmitter(getNativeModule());
75
+ return emitter.addListener(READY_EVENT, () => handler());
63
76
  }
64
77
  };
65
78
  //# sourceMappingURL=nativeIos.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","ACTION_EVENT","LINKING_ERROR","nativeModule","RnErxesSdk","getNativeModule","OS","Error","ErxesNativeIOS","configure","options","setUser","customData","Object","fromEntries","entries","filter","_ref","value","undefined","map","_ref2","key","String","clearUser","showMessenger","showLauncher","hideLauncher","hideMessenger","addActionListener","handler","emitter","addListener","event","id"],"sourceRoot":"../../src","sources":["nativeIos.ts"],"mappings":"AAAA,SACEA,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,QAGH,cAAc;;AAErB;AACA;AACA;AACA;AACA;;AA2CA;AACA,MAAMC,YAAY,GAAG,eAAe;AAEpC,MAAMC,aAAa,GACjB,sHAAsH;AAExH,MAAMC,YAAY,GAAGJ,aAAa,CAACK,UAAyC;AAE5E,SAASC,eAAeA,CAAA,EAAoB;EAC1C,IAAIL,QAAQ,CAACM,EAAE,KAAK,KAAK,EAAE;IACzB,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;EACrE;EAEA,IAAI,CAACJ,YAAY,EAAE;IACjB,MAAM,IAAII,KAAK,CAACL,aAAa,CAAC;EAChC;EAEA,OAAOC,YAAY;AACrB;AAEA,OAAO,MAAMK,cAAc,GAAG;EAC5BC,SAASA,CAACC,OAAwB,EAAE;IAClC,OAAOL,eAAe,CAAC,CAAC,CAACI,SAAS,CAACC,OAAO,CAAC;EAC7C,CAAC;EACDC,OAAOA,CAACD,OAAsB,EAAE;IAC9B,MAAME,UAAU,GAAGC,MAAM,CAACC,WAAW,CACnCD,MAAM,CAACE,OAAO,CAACL,OAAO,CAACE,UAAU,IAAI,CAAC,CAAC,CAAC,CACrCI,MAAM,CAACC,IAAA;MAAA,IAAC,GAAGC,KAAK,CAAC,GAAAD,IAAA;MAAA,OAAKC,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS;IAAA,EAAC,CAC5DC,GAAG,CAACC,KAAA;MAAA,IAAC,CAACC,GAAG,EAAEJ,KAAK,CAAC,GAAAG,KAAA;MAAA,OAAK,CAACC,GAAG,EAAEC,MAAM,CAACL,KAAK,CAAC,CAAC;IAAA,EAC/C,CAAC;IAED,OAAOb,eAAe,CAAC,CAAC,CAACM,OAAO,CAAC;MAC/B,GAAGD,OAAO;MACVE;IACF,CAAC,CAAC;EACJ,CAAC;EACDY,SAASA,CAAA,EAAG;IACV,OAAOnB,eAAe,CAAC,CAAC,CAACmB,SAAS,CAAC,CAAC;EACtC,CAAC;EACDC,aAAaA,CAAA,EAAG;IACd,OAAOpB,eAAe,CAAC,CAAC,CAACoB,aAAa,CAAC,CAAC;EAC1C,CAAC;EACDC,YAAYA,CAAA,EAAG;IACb,OAAOrB,eAAe,CAAC,CAAC,CAACqB,YAAY,CAAC,CAAC;EACzC,CAAC;EACDC,YAAYA,CAAA,EAAG;IACb,OAAOtB,eAAe,CAAC,CAAC,CAACsB,YAAY,CAAC,CAAC;EACzC,CAAC;EACDC,aAAaA,CAAA,EAAG;IACd,OAAOvB,eAAe,CAAC,CAAC,CAACuB,aAAa,CAAC,CAAC;EAC1C,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEC,iBAAiBA,CAACC,OAA6B,EAAuB;IACpE,MAAMC,OAAO,GAAG,IAAIjC,kBAAkB,CACpCO,eAAe,CAAC,CAClB,CAAC;IACD,OAAO0B,OAAO,CAACC,WAAW,CAAC/B,YAAY,EAAGgC,KAAqB,IAC7DH,OAAO,CAACG,KAAK,CAACC,EAAE,CAClB,CAAC;EACH;AACF,CAAC"}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","ACTION_EVENT","READY_EVENT","LINKING_ERROR","nativeModule","RnErxesSdk","getNativeModule","OS","Error","ErxesNativeIOS","configure","options","setUser","customData","Object","fromEntries","entries","filter","_ref","value","undefined","map","_ref2","key","String","clearUser","showMessenger","showLauncher","hideLauncher","hideMessenger","addActionListener","handler","emitter","addListener","event","id","addReadyListener"],"sourceRoot":"../../src","sources":["nativeIos.ts"],"mappings":"AAAA,SACEA,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,QAGH,cAAc;;AAErB;AACA;AACA;AACA;AACA;;AA2CA;AACA,MAAMC,YAAY,GAAG,eAAe;;AAEpC;AACA,MAAMC,WAAW,GAAG,cAAc;AAElC,MAAMC,aAAa,GACjB,sHAAsH;AAExH,MAAMC,YAAY,GAAGL,aAAa,CAACM,UAAyC;AAE5E,SAASC,eAAeA,CAAA,EAAoB;EAC1C,IAAIN,QAAQ,CAACO,EAAE,KAAK,KAAK,EAAE;IACzB,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;EACrE;EAEA,IAAI,CAACJ,YAAY,EAAE;IACjB,MAAM,IAAII,KAAK,CAACL,aAAa,CAAC;EAChC;EAEA,OAAOC,YAAY;AACrB;AAEA,OAAO,MAAMK,cAAc,GAAG;EAC5BC,SAASA,CAACC,OAAwB,EAAE;IAClC,OAAOL,eAAe,CAAC,CAAC,CAACI,SAAS,CAACC,OAAO,CAAC;EAC7C,CAAC;EACDC,OAAOA,CAACD,OAAsB,EAAE;IAC9B,MAAME,UAAU,GAAGC,MAAM,CAACC,WAAW,CACnCD,MAAM,CAACE,OAAO,CAACL,OAAO,CAACE,UAAU,IAAI,CAAC,CAAC,CAAC,CACrCI,MAAM,CAACC,IAAA;MAAA,IAAC,GAAGC,KAAK,CAAC,GAAAD,IAAA;MAAA,OAAKC,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS;IAAA,EAAC,CAC5DC,GAAG,CAACC,KAAA;MAAA,IAAC,CAACC,GAAG,EAAEJ,KAAK,CAAC,GAAAG,KAAA;MAAA,OAAK,CAACC,GAAG,EAAEC,MAAM,CAACL,KAAK,CAAC,CAAC;IAAA,EAC/C,CAAC;IAED,OAAOb,eAAe,CAAC,CAAC,CAACM,OAAO,CAAC;MAC/B,GAAGD,OAAO;MACVE;IACF,CAAC,CAAC;EACJ,CAAC;EACDY,SAASA,CAAA,EAAG;IACV,OAAOnB,eAAe,CAAC,CAAC,CAACmB,SAAS,CAAC,CAAC;EACtC,CAAC;EACDC,aAAaA,CAAA,EAAG;IACd,OAAOpB,eAAe,CAAC,CAAC,CAACoB,aAAa,CAAC,CAAC;EAC1C,CAAC;EACDC,YAAYA,CAAA,EAAG;IACb,OAAOrB,eAAe,CAAC,CAAC,CAACqB,YAAY,CAAC,CAAC;EACzC,CAAC;EACDC,YAAYA,CAAA,EAAG;IACb,OAAOtB,eAAe,CAAC,CAAC,CAACsB,YAAY,CAAC,CAAC;EACzC,CAAC;EACDC,aAAaA,CAAA,EAAG;IACd,OAAOvB,eAAe,CAAC,CAAC,CAACuB,aAAa,CAAC,CAAC;EAC1C,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEC,iBAAiBA,CAACC,OAA6B,EAAuB;IACpE,MAAMC,OAAO,GAAG,IAAIlC,kBAAkB,CACpCQ,eAAe,CAAC,CAClB,CAAC;IACD,OAAO0B,OAAO,CAACC,WAAW,CAAChC,YAAY,EAAGiC,KAAqB,IAC7DH,OAAO,CAACG,KAAK,CAACC,EAAE,CAClB,CAAC;EACH,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEC,gBAAgBA,CAACL,OAAmB,EAAuB;IACzD,MAAMC,OAAO,GAAG,IAAIlC,kBAAkB,CACpCQ,eAAe,CAAC,CAClB,CAAC;IACD,OAAO0B,OAAO,CAACC,WAAW,CAAC/B,WAAW,EAAE,MAAM6B,OAAO,CAAC,CAAC,CAAC;EAC1D;AACF,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type NativeIOSUser } from './nativeIos';
3
+ /**
4
+ * The identified end user. Same shape the native bridge expects — passing
5
+ * `undefined` leaves the visitor anonymous until you call `setUser` later.
6
+ */
7
+ export type ErxesUser = NativeIOSUser;
8
+ /**
9
+ * Helpers handed to action `onPress` callbacks (and `onAction`) so you can drive
10
+ * the messenger imperatively from inside a tap handler — show/hide it, toggle the
11
+ * launcher, or swap the user.
12
+ */
13
+ export type ErxesMessengerHelpers = {
14
+ show: () => Promise<void>;
15
+ hide: () => Promise<void>;
16
+ showLauncher: () => Promise<void>;
17
+ hideLauncher: () => Promise<void>;
18
+ setUser: (user: ErxesUser) => Promise<void>;
19
+ clearUser: () => Promise<void>;
20
+ };
21
+ /**
22
+ * A chat-mode action rendered in the header (`homeActions`) or drawer
23
+ * (`drawerActions`). Only `id`/`title`/`systemIcon` cross the native bridge; the
24
+ * `onPress` callback stays in JS and runs when the matching action is tapped.
25
+ */
26
+ export type ErxesAction = {
27
+ /** Identifier echoed back from native when the action is tapped. */
28
+ id: string;
29
+ /** Display title (drawer rows / accessibility label for header icons). */
30
+ title: string;
31
+ /** SF Symbol name, e.g. "person.crop.circle". */
32
+ systemIcon: string;
33
+ /** Runs when this action is tapped. Receives imperative {@link ErxesMessengerHelpers}. */
34
+ onPress?: (helpers: ErxesMessengerHelpers) => void | Promise<void>;
35
+ };
36
+ export type ErxesMessengerProps = {
37
+ /** erxes messenger integration id. Required. */
38
+ integrationId: string;
39
+ /** Full endpoint URL. Provide one of `endpoint`/`serverUrl`/`subDomain`. */
40
+ endpoint?: string;
41
+ /** Alias for `endpoint`. */
42
+ serverUrl?: string;
43
+ /** Sub-domain shorthand, e.g. `'yourcompany.erxes.io'`. */
44
+ subDomain?: string;
45
+ /** UI shell to present. Defaults to `'classic'` (the sheet-based widget). */
46
+ displayMode?: 'classic' | 'chat';
47
+ /** Identify the user before connecting. */
48
+ user?: ErxesUser;
49
+ /** Reuse a previously cached customer id. */
50
+ cachedCustomerId?: string;
51
+ /** Primary accent color as a hex string, e.g. `'#3f78d9'`. */
52
+ primaryColor?: string;
53
+ /** Controlled visibility. When set, drives show/hide on change. */
54
+ visible?: boolean;
55
+ /** Open the messenger once configured. Defaults to `true` in chat mode. */
56
+ autoOpen?: boolean;
57
+ /** Hide the messenger when the component unmounts. Defaults to `true`. */
58
+ autoHideOnUnmount?: boolean;
59
+ /** Show (`true`) or hide (`false`) the floating launcher after configure. */
60
+ launcherVisible?: boolean;
61
+ /** Chat-mode header-right actions. Ignored in `'classic'`. */
62
+ homeActions?: ErxesAction[];
63
+ /** Chat-mode drawer top action rows. Ignored in `'classic'`. */
64
+ drawerActions?: ErxesAction[];
65
+ /**
66
+ * Rendered while the SDK is configuring (between `onLoad` and
67
+ * `onReady`/`onError`), e.g. a spinner shown before the native messenger
68
+ * appears. Returns `null` otherwise. Defaults to rendering nothing.
69
+ */
70
+ renderLoading?: () => ReactNode;
71
+ /** Fired when setup starts. */
72
+ onLoad?: () => void;
73
+ /** Fired when the connection handshake completes (the messenger is ready). */
74
+ onReady?: () => void;
75
+ /** Fired when the loading state changes (`true` while configuring). */
76
+ onLoadingChange?: (loading: boolean) => void;
77
+ /** Fired when the messenger is shown. */
78
+ onOpen?: () => void;
79
+ /** Fired when the messenger is hidden. */
80
+ onClose?: () => void;
81
+ /** Fired when setup/open/hide fails. */
82
+ onError?: (error: unknown) => void;
83
+ /** Fallback for tapped actions that have no `onPress`. */
84
+ onAction?: (id: string, helpers: ErxesMessengerHelpers) => void | Promise<void>;
85
+ };
86
+ /**
87
+ * Declarative wrapper around {@link ErxesNativeIOS}. Configures the native erxes
88
+ * messenger, wires up action taps, and manages the show/hide lifecycle so app
89
+ * code stays a single component. Renders nothing — the messenger UI is presented
90
+ * natively over your app.
91
+ *
92
+ * For advanced/imperative control, use `ErxesNativeIOS` directly.
93
+ */
94
+ export declare function ErxesMessenger({ integrationId, endpoint, serverUrl, subDomain, displayMode, user, cachedCustomerId, primaryColor, visible, autoOpen, autoHideOnUnmount, launcherVisible, homeActions, drawerActions, renderLoading, onLoad, onReady, onOpen, onClose, onError, onAction, onLoadingChange, }: ErxesMessengerProps): ReactNode;
95
+ //# sourceMappingURL=ErxesMessenger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErxesMessenger.d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B,YAAY,EACZ,OAAO,EACP,QAAiC,EACjC,iBAAwB,EACxB,eAAe,EACf,WAAgB,EAChB,aAAkB,EAClB,aAAa,EACb,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,GAChB,EAAE,mBAAmB,aAmLrB"}
@@ -1,3 +1,5 @@
1
1
  export { ErxesNativeIOS } from './nativeIos';
2
2
  export type { NativeIOSAction, NativeIOSConfig, NativeIOSUser, } from './nativeIos';
3
+ export { ErxesMessenger } from './ErxesMessenger';
4
+ export type { ErxesUser, ErxesAction, ErxesMessengerHelpers, ErxesMessengerProps, } from './ErxesMessenger';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EACV,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EACV,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
@@ -48,6 +48,13 @@ export declare const ErxesNativeIOS: {
48
48
  * to stop listening.
49
49
  */
50
50
  addActionListener(handler: (id: string) => void): EmitterSubscription;
51
+ /**
52
+ * Listen for the connect handshake completing — i.e. the messenger is ready
53
+ * (`MessengerSDK.isReady`). Fires once per connection; if already connected
54
+ * when you subscribe via a fresh `configure`, it fires again. Returns a
55
+ * subscription — call `.remove()` to stop listening.
56
+ */
57
+ addReadyListener(handler: () => void): EmitterSubscription;
51
58
  };
52
59
  export type { NativeIOSAction, NativeIOSConfig, NativeIOSUser };
53
60
  //# sourceMappingURL=nativeIos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nativeIos.d.ts","sourceRoot":"","sources":["../../src/nativeIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EAEzB,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,KAAK,eAAe,GAAG;IACrB,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IACjC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,gEAAgE;IAChE,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;IAClC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CAC3E,CAAC;AAgCF,eAAO,MAAM,cAAc;uBACN,eAAe;qBAGjB,aAAa;;;;;;IA2B9B;;;;;OAKG;oCAC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AI,GAAG,mBAAmB;IAQrE;;;;;OAKG;8BACuB,MAAM,IAAI,GAAG,mBAAmB;CAM3D,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-erxes-sdk",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "react-native erxes sdk",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",