@multiplayer-app/session-recorder-react-native 1.3.36 → 2.0.17-alpha.10

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 (289) hide show
  1. package/package.json +13 -8
  2. package/src/NativeSessionRecorderModule.ts +4 -2
  3. package/src/NativeSessionRecorderModuleSpec.ts +4 -2
  4. package/src/NativeSessionRecorderNative.ts +1 -1
  5. package/src/index.ts +0 -1
  6. package/src/native/SessionRecorderNative.ts +22 -13
  7. package/src/otel/helpers.ts +5 -1
  8. package/src/otel/index.ts +1 -1
  9. package/src/otel/instrumentations/index.ts +22 -22
  10. package/src/patch/configs.ts +15 -10
  11. package/src/patch/fetch.ts +98 -89
  12. package/src/patch/index.ts +1 -1
  13. package/src/patch/xhr.ts +3 -4
  14. package/src/services/screenRecordingService.ts +7 -2
  15. package/src/services/storage.service.ts +4 -1
  16. package/src/session-recorder.ts +4 -0
  17. package/src/types/configs.ts +1 -2
  18. package/lib/module/NativeSessionRecorderModule.js +0 -5
  19. package/lib/module/NativeSessionRecorderModule.js.map +0 -1
  20. package/lib/module/NativeSessionRecorderModuleSpec.js +0 -5
  21. package/lib/module/NativeSessionRecorderModuleSpec.js.map +0 -1
  22. package/lib/module/NativeSessionRecorderNative.js +0 -5
  23. package/lib/module/NativeSessionRecorderNative.js.map +0 -1
  24. package/lib/module/components/ErrorBoundary.js +0 -32
  25. package/lib/module/components/ErrorBoundary.js.map +0 -1
  26. package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js +0 -23
  27. package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js.map +0 -1
  28. package/lib/module/components/ScreenRecorderView/index.js +0 -4
  29. package/lib/module/components/ScreenRecorderView/index.js.map +0 -1
  30. package/lib/module/components/SessionRecorderWidget/ErrorBanner.js +0 -64
  31. package/lib/module/components/SessionRecorderWidget/ErrorBanner.js.map +0 -1
  32. package/lib/module/components/SessionRecorderWidget/FinalPopover.js +0 -74
  33. package/lib/module/components/SessionRecorderWidget/FinalPopover.js.map +0 -1
  34. package/lib/module/components/SessionRecorderWidget/FloatingButton.js +0 -191
  35. package/lib/module/components/SessionRecorderWidget/FloatingButton.js.map +0 -1
  36. package/lib/module/components/SessionRecorderWidget/InitialPopover.js +0 -138
  37. package/lib/module/components/SessionRecorderWidget/InitialPopover.js.map +0 -1
  38. package/lib/module/components/SessionRecorderWidget/ModalContainer.js +0 -177
  39. package/lib/module/components/SessionRecorderWidget/ModalContainer.js.map +0 -1
  40. package/lib/module/components/SessionRecorderWidget/ModalHeader.js +0 -27
  41. package/lib/module/components/SessionRecorderWidget/ModalHeader.js.map +0 -1
  42. package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js +0 -133
  43. package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js.map +0 -1
  44. package/lib/module/components/SessionRecorderWidget/icons.js +0 -93
  45. package/lib/module/components/SessionRecorderWidget/icons.js.map +0 -1
  46. package/lib/module/components/SessionRecorderWidget/index.js +0 -5
  47. package/lib/module/components/SessionRecorderWidget/index.js.map +0 -1
  48. package/lib/module/components/SessionRecorderWidget/styles.js +0 -173
  49. package/lib/module/components/SessionRecorderWidget/styles.js.map +0 -1
  50. package/lib/module/components/index.js +0 -6
  51. package/lib/module/components/index.js.map +0 -1
  52. package/lib/module/config/constants.js +0 -47
  53. package/lib/module/config/constants.js.map +0 -1
  54. package/lib/module/config/defaults.js +0 -87
  55. package/lib/module/config/defaults.js.map +0 -1
  56. package/lib/module/config/index.js +0 -9
  57. package/lib/module/config/index.js.map +0 -1
  58. package/lib/module/config/masking.js +0 -35
  59. package/lib/module/config/masking.js.map +0 -1
  60. package/lib/module/config/session-recorder.js +0 -50
  61. package/lib/module/config/session-recorder.js.map +0 -1
  62. package/lib/module/config/validators.js +0 -28
  63. package/lib/module/config/validators.js.map +0 -1
  64. package/lib/module/config/widget.js +0 -35
  65. package/lib/module/config/widget.js.map +0 -1
  66. package/lib/module/context/SessionRecorderContext.js +0 -100
  67. package/lib/module/context/SessionRecorderContext.js.map +0 -1
  68. package/lib/module/context/SessionRecorderStore.js +0 -12
  69. package/lib/module/context/SessionRecorderStore.js.map +0 -1
  70. package/lib/module/context/createStore.js +0 -27
  71. package/lib/module/context/createStore.js.map +0 -1
  72. package/lib/module/context/useSessionRecorderStore.js +0 -45
  73. package/lib/module/context/useSessionRecorderStore.js.map +0 -1
  74. package/lib/module/context/useStoreSelector.js +0 -27
  75. package/lib/module/context/useStoreSelector.js.map +0 -1
  76. package/lib/module/index.js +0 -14
  77. package/lib/module/index.js.map +0 -1
  78. package/lib/module/native/SessionRecorderNative.js +0 -76
  79. package/lib/module/native/SessionRecorderNative.js.map +0 -1
  80. package/lib/module/native/index.js +0 -4
  81. package/lib/module/native/index.js.map +0 -1
  82. package/lib/module/otel/CrashBufferSpanProcessor.js +0 -42
  83. package/lib/module/otel/CrashBufferSpanProcessor.js.map +0 -1
  84. package/lib/module/otel/helpers.js +0 -218
  85. package/lib/module/otel/helpers.js.map +0 -1
  86. package/lib/module/otel/index.js +0 -202
  87. package/lib/module/otel/index.js.map +0 -1
  88. package/lib/module/otel/instrumentations/index.js +0 -122
  89. package/lib/module/otel/instrumentations/index.js.map +0 -1
  90. package/lib/module/package.json +0 -1
  91. package/lib/module/patch/configs.js +0 -18
  92. package/lib/module/patch/configs.js.map +0 -1
  93. package/lib/module/patch/fetch.js +0 -224
  94. package/lib/module/patch/fetch.js.map +0 -1
  95. package/lib/module/patch/index.js +0 -6
  96. package/lib/module/patch/index.js.map +0 -1
  97. package/lib/module/patch/xhr.js +0 -100
  98. package/lib/module/patch/xhr.js.map +0 -1
  99. package/lib/module/recorder/gestureRecorder.js +0 -641
  100. package/lib/module/recorder/gestureRecorder.js.map +0 -1
  101. package/lib/module/recorder/index.js +0 -176
  102. package/lib/module/recorder/index.js.map +0 -1
  103. package/lib/module/recorder/navigationRecorder.js +0 -238
  104. package/lib/module/recorder/navigationRecorder.js.map +0 -1
  105. package/lib/module/recorder/screenRecorder.js +0 -527
  106. package/lib/module/recorder/screenRecorder.js.map +0 -1
  107. package/lib/module/services/api.service.js +0 -166
  108. package/lib/module/services/api.service.js.map +0 -1
  109. package/lib/module/services/crashBuffer.service.js +0 -280
  110. package/lib/module/services/crashBuffer.service.js.map +0 -1
  111. package/lib/module/services/network.service.js +0 -178
  112. package/lib/module/services/network.service.js.map +0 -1
  113. package/lib/module/services/screenRecordingService.js +0 -107
  114. package/lib/module/services/screenRecordingService.js.map +0 -1
  115. package/lib/module/services/socket.service.js +0 -186
  116. package/lib/module/services/socket.service.js.map +0 -1
  117. package/lib/module/services/storage.service.js +0 -178
  118. package/lib/module/services/storage.service.js.map +0 -1
  119. package/lib/module/session-recorder.js +0 -750
  120. package/lib/module/session-recorder.js.map +0 -1
  121. package/lib/module/types/configs.js +0 -4
  122. package/lib/module/types/configs.js.map +0 -1
  123. package/lib/module/types/expo-constants.d.js +0 -2
  124. package/lib/module/types/expo-constants.d.js.map +0 -1
  125. package/lib/module/types/index.js +0 -10
  126. package/lib/module/types/index.js.map +0 -1
  127. package/lib/module/types/session-recorder.js +0 -68
  128. package/lib/module/types/session-recorder.js.map +0 -1
  129. package/lib/module/utils/app-metadata.js +0 -28
  130. package/lib/module/utils/app-metadata.js.map +0 -1
  131. package/lib/module/utils/constants.optional.expo.js +0 -6
  132. package/lib/module/utils/constants.optional.expo.js.map +0 -1
  133. package/lib/module/utils/constants.optional.js +0 -8
  134. package/lib/module/utils/constants.optional.js.map +0 -1
  135. package/lib/module/utils/index.js +0 -11
  136. package/lib/module/utils/index.js.map +0 -1
  137. package/lib/module/utils/logger.js +0 -185
  138. package/lib/module/utils/logger.js.map +0 -1
  139. package/lib/module/utils/platform.js +0 -340
  140. package/lib/module/utils/platform.js.map +0 -1
  141. package/lib/module/utils/request-utils.js +0 -58
  142. package/lib/module/utils/request-utils.js.map +0 -1
  143. package/lib/module/utils/rrweb-events.js +0 -276
  144. package/lib/module/utils/rrweb-events.js.map +0 -1
  145. package/lib/module/utils/session.js +0 -21
  146. package/lib/module/utils/session.js.map +0 -1
  147. package/lib/module/utils/shallowEqual.js +0 -17
  148. package/lib/module/utils/shallowEqual.js.map +0 -1
  149. package/lib/module/utils/time.js +0 -17
  150. package/lib/module/utils/time.js.map +0 -1
  151. package/lib/module/utils/type-utils.js +0 -69
  152. package/lib/module/utils/type-utils.js.map +0 -1
  153. package/lib/module/version.js +0 -4
  154. package/lib/module/version.js.map +0 -1
  155. package/lib/typescript/package.json +0 -1
  156. package/lib/typescript/src/NativeSessionRecorderModule.d.ts +0 -25
  157. package/lib/typescript/src/NativeSessionRecorderModule.d.ts.map +0 -1
  158. package/lib/typescript/src/NativeSessionRecorderModuleSpec.d.ts +0 -25
  159. package/lib/typescript/src/NativeSessionRecorderModuleSpec.d.ts.map +0 -1
  160. package/lib/typescript/src/NativeSessionRecorderNative.d.ts +0 -25
  161. package/lib/typescript/src/NativeSessionRecorderNative.d.ts.map +0 -1
  162. package/lib/typescript/src/components/ErrorBoundary.d.ts +0 -16
  163. package/lib/typescript/src/components/ErrorBoundary.d.ts.map +0 -1
  164. package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts +0 -6
  165. package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts.map +0 -1
  166. package/lib/typescript/src/components/ScreenRecorderView/index.d.ts +0 -2
  167. package/lib/typescript/src/components/ScreenRecorderView/index.d.ts.map +0 -1
  168. package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts +0 -8
  169. package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts.map +0 -1
  170. package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts +0 -13
  171. package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts.map +0 -1
  172. package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts +0 -9
  173. package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts.map +0 -1
  174. package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts +0 -17
  175. package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts.map +0 -1
  176. package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts +0 -9
  177. package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts.map +0 -1
  178. package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts +0 -7
  179. package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts.map +0 -1
  180. package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts +0 -6
  181. package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts.map +0 -1
  182. package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts +0 -12
  183. package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts.map +0 -1
  184. package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts +0 -3
  185. package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts.map +0 -1
  186. package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts +0 -166
  187. package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts.map +0 -1
  188. package/lib/typescript/src/components/index.d.ts +0 -4
  189. package/lib/typescript/src/components/index.d.ts.map +0 -1
  190. package/lib/typescript/src/config/constants.d.ts +0 -22
  191. package/lib/typescript/src/config/constants.d.ts.map +0 -1
  192. package/lib/typescript/src/config/defaults.d.ts +0 -5
  193. package/lib/typescript/src/config/defaults.d.ts.map +0 -1
  194. package/lib/typescript/src/config/index.d.ts +0 -6
  195. package/lib/typescript/src/config/index.d.ts.map +0 -1
  196. package/lib/typescript/src/config/masking.d.ts +0 -3
  197. package/lib/typescript/src/config/masking.d.ts.map +0 -1
  198. package/lib/typescript/src/config/session-recorder.d.ts +0 -3
  199. package/lib/typescript/src/config/session-recorder.d.ts.map +0 -1
  200. package/lib/typescript/src/config/validators.d.ts +0 -11
  201. package/lib/typescript/src/config/validators.d.ts.map +0 -1
  202. package/lib/typescript/src/config/widget.d.ts +0 -10
  203. package/lib/typescript/src/config/widget.d.ts.map +0 -1
  204. package/lib/typescript/src/context/SessionRecorderContext.d.ts +0 -22
  205. package/lib/typescript/src/context/SessionRecorderContext.d.ts.map +0 -1
  206. package/lib/typescript/src/context/SessionRecorderStore.d.ts +0 -13
  207. package/lib/typescript/src/context/SessionRecorderStore.d.ts.map +0 -1
  208. package/lib/typescript/src/context/createStore.d.ts +0 -9
  209. package/lib/typescript/src/context/createStore.d.ts.map +0 -1
  210. package/lib/typescript/src/context/useSessionRecorderStore.d.ts +0 -29
  211. package/lib/typescript/src/context/useSessionRecorderStore.d.ts.map +0 -1
  212. package/lib/typescript/src/context/useStoreSelector.d.ts +0 -5
  213. package/lib/typescript/src/context/useStoreSelector.d.ts.map +0 -1
  214. package/lib/typescript/src/index.d.ts +0 -9
  215. package/lib/typescript/src/index.d.ts.map +0 -1
  216. package/lib/typescript/src/native/SessionRecorderNative.d.ts +0 -29
  217. package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +0 -1
  218. package/lib/typescript/src/native/index.d.ts +0 -2
  219. package/lib/typescript/src/native/index.d.ts.map +0 -1
  220. package/lib/typescript/src/otel/CrashBufferSpanProcessor.d.ts +0 -17
  221. package/lib/typescript/src/otel/CrashBufferSpanProcessor.d.ts.map +0 -1
  222. package/lib/typescript/src/otel/helpers.d.ts +0 -46
  223. package/lib/typescript/src/otel/helpers.d.ts.map +0 -1
  224. package/lib/typescript/src/otel/index.d.ts +0 -33
  225. package/lib/typescript/src/otel/index.d.ts.map +0 -1
  226. package/lib/typescript/src/otel/instrumentations/index.d.ts +0 -5
  227. package/lib/typescript/src/otel/instrumentations/index.d.ts.map +0 -1
  228. package/lib/typescript/src/patch/configs.d.ts +0 -9
  229. package/lib/typescript/src/patch/configs.d.ts.map +0 -1
  230. package/lib/typescript/src/patch/fetch.d.ts +0 -2
  231. package/lib/typescript/src/patch/fetch.d.ts.map +0 -1
  232. package/lib/typescript/src/patch/index.d.ts +0 -4
  233. package/lib/typescript/src/patch/index.d.ts.map +0 -1
  234. package/lib/typescript/src/patch/xhr.d.ts +0 -2
  235. package/lib/typescript/src/patch/xhr.d.ts.map +0 -1
  236. package/lib/typescript/src/recorder/gestureRecorder.d.ts +0 -66
  237. package/lib/typescript/src/recorder/gestureRecorder.d.ts.map +0 -1
  238. package/lib/typescript/src/recorder/index.d.ts +0 -79
  239. package/lib/typescript/src/recorder/index.d.ts.map +0 -1
  240. package/lib/typescript/src/recorder/navigationRecorder.d.ts +0 -29
  241. package/lib/typescript/src/recorder/navigationRecorder.d.ts.map +0 -1
  242. package/lib/typescript/src/recorder/screenRecorder.d.ts +0 -127
  243. package/lib/typescript/src/recorder/screenRecorder.d.ts.map +0 -1
  244. package/lib/typescript/src/services/api.service.d.ts +0 -116
  245. package/lib/typescript/src/services/api.service.d.ts.map +0 -1
  246. package/lib/typescript/src/services/crashBuffer.service.d.ts +0 -27
  247. package/lib/typescript/src/services/crashBuffer.service.d.ts.map +0 -1
  248. package/lib/typescript/src/services/network.service.d.ts +0 -47
  249. package/lib/typescript/src/services/network.service.d.ts.map +0 -1
  250. package/lib/typescript/src/services/screenRecordingService.d.ts +0 -48
  251. package/lib/typescript/src/services/screenRecordingService.d.ts.map +0 -1
  252. package/lib/typescript/src/services/socket.service.d.ts +0 -44
  253. package/lib/typescript/src/services/socket.service.d.ts.map +0 -1
  254. package/lib/typescript/src/services/storage.service.d.ts +0 -47
  255. package/lib/typescript/src/services/storage.service.d.ts.map +0 -1
  256. package/lib/typescript/src/session-recorder.d.ts +0 -191
  257. package/lib/typescript/src/session-recorder.d.ts.map +0 -1
  258. package/lib/typescript/src/types/configs.d.ts +0 -92
  259. package/lib/typescript/src/types/configs.d.ts.map +0 -1
  260. package/lib/typescript/src/types/index.d.ts +0 -21
  261. package/lib/typescript/src/types/index.d.ts.map +0 -1
  262. package/lib/typescript/src/types/session-recorder.d.ts +0 -367
  263. package/lib/typescript/src/types/session-recorder.d.ts.map +0 -1
  264. package/lib/typescript/src/utils/app-metadata.d.ts +0 -17
  265. package/lib/typescript/src/utils/app-metadata.d.ts.map +0 -1
  266. package/lib/typescript/src/utils/constants.optional.d.ts +0 -22
  267. package/lib/typescript/src/utils/constants.optional.d.ts.map +0 -1
  268. package/lib/typescript/src/utils/constants.optional.expo.d.ts +0 -4
  269. package/lib/typescript/src/utils/constants.optional.expo.d.ts.map +0 -1
  270. package/lib/typescript/src/utils/index.d.ts +0 -8
  271. package/lib/typescript/src/utils/index.d.ts.map +0 -1
  272. package/lib/typescript/src/utils/logger.d.ts +0 -108
  273. package/lib/typescript/src/utils/logger.d.ts.map +0 -1
  274. package/lib/typescript/src/utils/platform.d.ts +0 -58
  275. package/lib/typescript/src/utils/platform.d.ts.map +0 -1
  276. package/lib/typescript/src/utils/request-utils.d.ts +0 -22
  277. package/lib/typescript/src/utils/request-utils.d.ts.map +0 -1
  278. package/lib/typescript/src/utils/rrweb-events.d.ts +0 -67
  279. package/lib/typescript/src/utils/rrweb-events.d.ts.map +0 -1
  280. package/lib/typescript/src/utils/session.d.ts +0 -7
  281. package/lib/typescript/src/utils/session.d.ts.map +0 -1
  282. package/lib/typescript/src/utils/shallowEqual.d.ts +0 -2
  283. package/lib/typescript/src/utils/shallowEqual.d.ts.map +0 -1
  284. package/lib/typescript/src/utils/time.d.ts +0 -5
  285. package/lib/typescript/src/utils/time.d.ts.map +0 -1
  286. package/lib/typescript/src/utils/type-utils.d.ts +0 -17
  287. package/lib/typescript/src/utils/type-utils.d.ts.map +0 -1
  288. package/lib/typescript/src/version.d.ts +0 -2
  289. package/lib/typescript/src/version.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
1
  import './xhr';
2
2
  import './fetch';
3
3
 
4
- export * from './configs'
4
+ export * from './configs';
package/src/patch/xhr.ts CHANGED
@@ -2,7 +2,6 @@ import { configs } from './configs';
2
2
  import { formDataToQuery } from '../utils/request-utils';
3
3
  import { isFormData, isNullish, isObject, isString } from '../utils/type-utils';
4
4
 
5
-
6
5
  function _tryReadXHRBody({
7
6
  body,
8
7
  }: {
@@ -52,7 +51,7 @@ if (typeof XMLHttpRequest !== 'undefined') {
52
51
  responseBody?: any;
53
52
  } = {};
54
53
 
55
- // @ts-ignore
54
+ // ts-expect-error
56
55
  const requestHeaders: Record<string, string> = {};
57
56
  const originalSetRequestHeader = xhr.setRequestHeader.bind(xhr);
58
57
  xhr.setRequestHeader = (header: string, value: string) => {
@@ -83,7 +82,7 @@ if (typeof XMLHttpRequest !== 'undefined') {
83
82
  return;
84
83
  }
85
84
 
86
- // @ts-ignore
85
+ // ts-expect-error
87
86
  const responseHeaders: Record<string, string> = {};
88
87
  const rawHeaders = xhr.getAllResponseHeaders() || '';
89
88
  const headers = rawHeaders
@@ -114,7 +113,7 @@ if (typeof XMLHttpRequest !== 'undefined') {
114
113
  }
115
114
  });
116
115
 
117
- // @ts-ignore
116
+ // @ts-expect-error
118
117
  xhr.networkRequest = networkRequest;
119
118
 
120
119
  originalOpen.call(xhr, method, url as string, async, username, password);
@@ -1,4 +1,6 @@
1
- import SessionRecorderNative, { type MaskingOptions } from '../native/SessionRecorderNative';
1
+ import SessionRecorderNative, {
2
+ type MaskingOptions,
3
+ } from '../native/SessionRecorderNative';
2
4
  import { logger } from '../utils';
3
5
 
4
6
  export interface ScreenRecordingConfig {
@@ -129,7 +131,10 @@ export class ScreenRecordingService {
129
131
  */
130
132
  updateConfig(config: Partial<ScreenRecordingConfig>): void {
131
133
  this.config = { ...this.config, ...config };
132
- logger.info('ScreenRecordingService', 'Screen masking configuration updated');
134
+ logger.info(
135
+ 'ScreenRecordingService',
136
+ 'Screen masking configuration updated'
137
+ );
133
138
  }
134
139
 
135
140
  /**
@@ -1,5 +1,8 @@
1
1
  import { Platform } from 'react-native';
2
- import { SessionType, type ISession } from '@multiplayer-app/session-recorder-common';
2
+ import {
3
+ SessionType,
4
+ type ISession,
5
+ } from '@multiplayer-app/session-recorder-common';
3
6
  import { logger } from '../utils';
4
7
  import type { SessionState } from '../types';
5
8
 
@@ -355,6 +355,7 @@ class SessionRecorder
355
355
  // Start capturing events without an active debug session id.
356
356
  try {
357
357
  this._recorder.stop();
358
+ // eslint-disable-next-line no-empty
358
359
  } catch (_e) {}
359
360
  this._recorder.start(null, SessionType.MANUAL);
360
361
  }
@@ -657,12 +658,14 @@ class SessionRecorder
657
658
  */
658
659
  private _start(): void {
659
660
  this.sessionState = SessionState.started;
661
+ // eslint-disable-next-line no-self-assign
660
662
  this.sessionType = this.sessionType;
661
663
 
662
664
  if (this.sessionId) {
663
665
  // Switch from buffer-only recording to session recording cleanly.
664
666
  try {
665
667
  this._recorder.stop();
668
+ // eslint-disable-next-line no-empty
666
669
  } catch (_e) {}
667
670
  this._tracer.start(this.sessionId, this.sessionType);
668
671
  this._recorder.start(this.sessionId, this.sessionType);
@@ -700,6 +703,7 @@ class SessionRecorder
700
703
  this._tracer.start(this.sessionId, this.sessionType);
701
704
  try {
702
705
  this._recorder.stop();
706
+ // eslint-disable-next-line no-empty
703
707
  } catch (_e) {}
704
708
  this._recorder.start(this.sessionId, this.sessionType);
705
709
  }
@@ -22,8 +22,7 @@ export type DeepRequired<T> = T extends Function
22
22
  * Fully resolved configuration interface
23
23
  * All optional properties from SessionRecorderOptions are now required
24
24
  */
25
- export interface SessionRecorderConfigs
26
- extends DeepRequired<SessionRecorderOptions> {}
25
+ export interface SessionRecorderConfigs extends DeepRequired<SessionRecorderOptions> {}
27
26
 
28
27
  /**
29
28
  * Base configuration interface with common properties
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('SessionRecorderNative');
5
- //# sourceMappingURL=NativeSessionRecorderModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSessionRecorderModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('SessionRecorderNative');
5
- //# sourceMappingURL=NativeSessionRecorderModuleSpec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSessionRecorderModuleSpec.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('SessionRecorderNative');
5
- //# sourceMappingURL=NativeSessionRecorderNative.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSessionRecorderNative.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import SessionRecorder from "../session-recorder.js";
5
- export class ErrorBoundary extends React.Component {
6
- constructor(props) {
7
- super(props);
8
- this.state = {
9
- hasError: false
10
- };
11
- }
12
- static getDerivedStateFromError() {
13
- return {
14
- hasError: true
15
- };
16
- }
17
- componentDidCatch(error) {
18
- try {
19
- SessionRecorder.captureException(error);
20
- } catch (_e) {
21
- // ignore
22
- }
23
- }
24
- render() {
25
- if (this.state.hasError) {
26
- return this.props.fallback ?? null;
27
- }
28
- return this.props.children;
29
- }
30
- }
31
- export default ErrorBoundary;
32
- //# sourceMappingURL=ErrorBoundary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","SessionRecorder","ErrorBoundary","Component","constructor","props","state","hasError","getDerivedStateFromError","componentDidCatch","error","captureException","_e","render","fallback","children"],"sourceRoot":"../../../src","sources":["components/ErrorBoundary.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,MAAM,wBAAqB;AASjD,OAAO,MAAMC,aAAa,SAASF,KAAK,CAACG,SAAS,CAA4B;EAC5EC,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MAAEC,QAAQ,EAAE;IAAM,CAAC;EAClC;EAEA,OAAOC,wBAAwBA,CAAA,EAAU;IACvC,OAAO;MAAED,QAAQ,EAAE;IAAK,CAAC;EAC3B;EAEAE,iBAAiBA,CAACC,KAAc,EAAQ;IACtC,IAAI;MACFT,eAAe,CAACU,gBAAgB,CAACD,KAAY,CAAC;IAChD,CAAC,CAAC,OAAOE,EAAE,EAAE;MACX;IAAA;EAEJ;EAEAC,MAAMA,CAAA,EAAoB;IACxB,IAAI,IAAI,CAACP,KAAK,CAACC,QAAQ,EAAE;MACvB,OAAO,IAAI,CAACF,KAAK,CAACS,QAAQ,IAAI,IAAI;IACpC;IACA,OAAO,IAAI,CAACT,KAAK,CAACU,QAAQ;EAC5B;AACF;AAEA,eAAeb,aAAa","ignoreList":[]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- import SessionRecorder from '@multiplayer-app/session-recorder-react-native';
4
- import { View } from 'react-native';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- export const ScreenRecorderView = ({
7
- children
8
- }) => {
9
- // Callback ref to set the viewshot ref immediately when available
10
- const setViewShotRef = ref => {
11
- if (ref) {
12
- SessionRecorder.setViewShotRef?.(ref);
13
- }
14
- };
15
- return /*#__PURE__*/_jsx(View, {
16
- ref: setViewShotRef,
17
- style: {
18
- flex: 1
19
- },
20
- children: children
21
- });
22
- };
23
- //# sourceMappingURL=ScreenRecorderView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["SessionRecorder","View","jsx","_jsx","ScreenRecorderView","children","setViewShotRef","ref","style","flex"],"sourceRoot":"../../../../src","sources":["components/ScreenRecorderView/ScreenRecorderView.tsx"],"mappings":";;AAAA,OAAOA,eAAe,MAAM,gDAAgD;AAE5E,SAASC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIpC,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC;AAAkC,CAAC,KAAK;EAC3E;EACA,MAAMC,cAAc,GAAIC,GAAoB,IAAK;IAC/C,IAAIA,GAAG,EAAE;MACPP,eAAe,CAACM,cAAc,GAAGC,GAAG,CAAC;IACvC;EACF,CAAC;EAED,oBACEJ,IAAA,CAACF,IAAI;IAACM,GAAG,EAAED,cAAe;IAACE,KAAK,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAE;IAAAJ,QAAA,EAC3CA;EAAQ,CACL,CAAC;AAEX,CAAC","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export * from "./ScreenRecorderView.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/ScreenRecorderView/index.ts"],"mappings":";;AAAA,cAAc,yBAAsB","ignoreList":[]}
@@ -1,64 +0,0 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { View, Text, Pressable, StyleSheet } from 'react-native';
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- const ErrorBanner = ({
7
- error,
8
- onDismiss
9
- }) => {
10
- return /*#__PURE__*/_jsx(View, {
11
- style: styles.container,
12
- children: /*#__PURE__*/_jsxs(View, {
13
- style: styles.content,
14
- children: [/*#__PURE__*/_jsx(Text, {
15
- style: styles.errorText,
16
- children: error
17
- }), /*#__PURE__*/_jsx(Pressable, {
18
- onPress: onDismiss,
19
- style: styles.dismissButton,
20
- children: /*#__PURE__*/_jsx(Text, {
21
- style: styles.dismissText,
22
- children: "\u2715"
23
- })
24
- })]
25
- })
26
- });
27
- };
28
- const styles = StyleSheet.create({
29
- container: {
30
- backgroundColor: '#ff4444',
31
- paddingHorizontal: 16,
32
- paddingVertical: 12,
33
- marginHorizontal: 16,
34
- marginTop: 8,
35
- borderRadius: 8
36
- },
37
- content: {
38
- flexDirection: 'row',
39
- alignItems: 'center',
40
- justifyContent: 'space-between'
41
- },
42
- errorText: {
43
- color: 'white',
44
- fontSize: 14,
45
- flex: 1,
46
- marginRight: 8
47
- },
48
- dismissButton: {
49
- padding: 4,
50
- borderRadius: 12,
51
- backgroundColor: 'rgba(255, 255, 255, 0.2)',
52
- width: 24,
53
- height: 24,
54
- alignItems: 'center',
55
- justifyContent: 'center'
56
- },
57
- dismissText: {
58
- color: 'white',
59
- fontSize: 12,
60
- fontWeight: 'bold'
61
- }
62
- });
63
- export default ErrorBanner;
64
- //# sourceMappingURL=ErrorBanner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","View","Text","Pressable","StyleSheet","jsx","_jsx","jsxs","_jsxs","ErrorBanner","error","onDismiss","style","styles","container","children","content","errorText","onPress","dismissButton","dismissText","create","backgroundColor","paddingHorizontal","paddingVertical","marginHorizontal","marginTop","borderRadius","flexDirection","alignItems","justifyContent","color","fontSize","flex","marginRight","padding","width","height","fontWeight"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/ErrorBanner.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOjE,MAAMC,WAAuC,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAU,CAAC,KAAK;EACxE,oBACEL,IAAA,CAACL,IAAI;IAACW,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,eAC5BP,KAAA,CAACP,IAAI;MAACW,KAAK,EAAEC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React, { useState } from 'react';
4
- import { View, Text, Pressable, TextInput, ScrollView, Keyboard } from 'react-native';
5
- import { sharedStyles } from "./styles.js";
6
- import ModalHeader from "./ModalHeader.js";
7
- import { logger } from "../../utils/index.js";
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- const FinalPopover = ({
10
- isOnline,
11
- textOverrides,
12
- onStopRecording,
13
- onCancelSession,
14
- isSubmitting,
15
- children
16
- }) => {
17
- const [comment, setComment] = useState('');
18
- const handleStopRecording = async () => {
19
- try {
20
- await onStopRecording(comment);
21
- } catch (error) {
22
- logger.error('FinalPopover', 'Failed to save session', error);
23
- }
24
- };
25
- return /*#__PURE__*/_jsxs(View, {
26
- style: sharedStyles.popoverContent,
27
- children: [/*#__PURE__*/_jsx(ModalHeader, {
28
- children: /*#__PURE__*/_jsx(Pressable, {
29
- onPress: onCancelSession,
30
- disabled: !isOnline,
31
- style: sharedStyles.cancelButton,
32
- children: /*#__PURE__*/_jsx(Text, {
33
- style: sharedStyles.cancelButtonText,
34
- children: textOverrides.cancelButtonText
35
- })
36
- })
37
- }), /*#__PURE__*/_jsxs(ScrollView, {
38
- style: sharedStyles.popoverBody,
39
- keyboardShouldPersistTaps: "handled",
40
- contentInsetAdjustmentBehavior: "automatic",
41
- children: [children, /*#__PURE__*/_jsx(Text, {
42
- style: sharedStyles.title,
43
- children: textOverrides.finalTitle
44
- }), /*#__PURE__*/_jsx(Text, {
45
- style: sharedStyles.description,
46
- children: textOverrides.finalDescription
47
- }), /*#__PURE__*/_jsx(TextInput, {
48
- style: sharedStyles.commentInput,
49
- placeholder: textOverrides.commentPlaceholder,
50
- placeholderTextColor: '#9CA3AF',
51
- value: comment,
52
- onChangeText: setComment,
53
- multiline: true,
54
- numberOfLines: 3,
55
- returnKeyType: "done",
56
- blurOnSubmit: true,
57
- onSubmitEditing: () => Keyboard.dismiss()
58
- }), /*#__PURE__*/_jsx(View, {
59
- style: sharedStyles.popoverFooter,
60
- children: /*#__PURE__*/_jsx(Pressable, {
61
- disabled: isSubmitting || !isOnline,
62
- style: [sharedStyles.actionButton, sharedStyles.stopButton],
63
- onPress: handleStopRecording,
64
- children: /*#__PURE__*/_jsx(Text, {
65
- style: sharedStyles.actionButtonText,
66
- children: isSubmitting ? 'Saving...' : textOverrides.saveButtonText
67
- })
68
- })
69
- })]
70
- })]
71
- });
72
- };
73
- export default FinalPopover;
74
- //# sourceMappingURL=FinalPopover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useState","View","Text","Pressable","TextInput","ScrollView","Keyboard","sharedStyles","ModalHeader","logger","jsx","_jsx","jsxs","_jsxs","FinalPopover","isOnline","textOverrides","onStopRecording","onCancelSession","isSubmitting","children","comment","setComment","handleStopRecording","error","style","popoverContent","onPress","disabled","cancelButton","cancelButtonText","popoverBody","keyboardShouldPersistTaps","contentInsetAdjustmentBehavior","title","finalTitle","description","finalDescription","commentInput","placeholder","commentPlaceholder","placeholderTextColor","value","onChangeText","multiline","numberOfLines","returnKeyType","blurOnSubmit","onSubmitEditing","dismiss","popoverFooter","actionButton","stopButton","actionButtonText","saveButtonText"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/FinalPopover.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SACEC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,QAAQ,QACH,cAAc;AAErB,SAASC,YAAY,QAAQ,aAAU;AACvC,OAAOC,WAAW,MAAM,kBAAe;AACvC,SAASC,MAAM,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWrC,MAAMC,YAAyC,GAAGA,CAAC;EACjDC,QAAQ;EACRC,aAAa;EACbC,eAAe;EACfC,eAAe;EACfC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGtB,QAAQ,CAAC,EA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S;QACTC,aAAa,EAAE,CAAE;QACjBC,aAAa,EAAC,MAAM;QACpBC,YAAY;QACZC,eAAe,EAAEA,CAAA,KAAM1C,QAAQ,CAAC2C,OAAO,CAAC;MAAE,CAC3C,CAAC,eAEFtC,IAAA,CAACV,IAAI;QAACwB,KAAK,EAAElB,YAAY,CAAC2C,aAAc;QAAA9B,QAAA,eACtCT,IAAA,CAACR,SAAS;UACRyB,QAAQ,EAAET,YAAY,IAAI,CAACJ,QAAS;UACpCU,KAAK,EAAE,CAAClB,YAAY,CAAC4C,YAAY,EAAE5C,YAAY,CAAC6C,UAAU,CAAE;UAC5DzB,OAAO,EAAEJ,mBAAoB;UAAAH,QAAA,eAE7BT,IAAA,CAACT,IAAI;YAACuB,KAAK,EAAElB,YAAY,CAAC8C,gBAAiB;YAAAjC,QAAA,EACxCD,YAAY,GAAG,WAAW,GAAGH,aAAa,CAACsC;UAAc,CACtD;QAAC,CACE;MAAC,CACR,CAAC;IAAA,CACG,CAAC;EAAA,CACT,CAAC;AAEX,CAAC;AAED,eAAexC,YAAY","ignoreList":[]}
@@ -1,191 +0,0 @@
1
- "use strict";
2
-
3
- import React, { useRef, useEffect, useMemo } from 'react';
4
- import { StyleSheet, Platform, Animated, PanResponder, View, Dimensions } from 'react-native';
5
- import { SessionState } from "../../types/index.js";
6
- import { StorageService } from "../../services/storage.service.js";
7
- import { RecordIcon, CapturingIcon, PausedIcon } from "./icons.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- const buttonSize = 52;
10
- const rightOffset = 20;
11
- const topOffset = Platform.OS === 'ios' ? 60 : 40;
12
- const FloatingButton = ({
13
- sessionState,
14
- onPress
15
- }) => {
16
- const position = useRef(new Animated.ValueXY({
17
- x: 0,
18
- y: 0
19
- })).current;
20
- const lastPosition = useRef({
21
- top: topOffset,
22
- right: rightOffset
23
- });
24
- const storageService = useRef(StorageService.getInstance()).current;
25
- const screenBounds = useMemo(() => {
26
- const {
27
- width,
28
- height
29
- } = Dimensions.get('window');
30
- return {
31
- minTop: topOffset,
32
- maxTop: height - buttonSize,
33
- minRight: 0,
34
- maxRight: width - buttonSize
35
- };
36
- }, []);
37
-
38
- // Load saved position on component mount
39
- useEffect(() => {
40
- const savedPosition = storageService.getFloatingButtonPosition();
41
- if (savedPosition) {
42
- const {
43
- width
44
- } = Dimensions.get('window');
45
- const top = savedPosition.y;
46
- const right = width - savedPosition.x - buttonSize;
47
- lastPosition.current = {
48
- top,
49
- right
50
- };
51
- position.setValue({
52
- x: right,
53
- y: top
54
- });
55
- } else {
56
- position.setValue({
57
- x: lastPosition.current.right,
58
- y: lastPosition.current.top
59
- });
60
- }
61
- }, []);
62
- const panResponder = useRef(PanResponder.create({
63
- onStartShouldSetPanResponder: () => true,
64
- onMoveShouldSetPanResponder: (_, gestureState) => {
65
- const distance = Math.sqrt(gestureState.dx * gestureState.dx + gestureState.dy * gestureState.dy);
66
- return distance > 5;
67
- },
68
- onPanResponderGrant: () => {
69
- // Set the initial position for this gesture
70
- position.setValue({
71
- x: lastPosition.current.right,
72
- y: lastPosition.current.top
73
- });
74
- },
75
- onPanResponderMove: (_, gestureState) => {
76
- // Calculate new position based on gesture movement
77
- const newTop = lastPosition.current.top + gestureState.dy;
78
- const newRight = lastPosition.current.right - gestureState.dx;
79
-
80
- // Update position during drag
81
- position.setValue({
82
- x: newRight,
83
- y: newTop
84
- });
85
- },
86
- onPanResponderRelease: (_, gestureState) => {
87
- // Check if this was actually a drag (significant movement)
88
- const distance = Math.sqrt(gestureState.dx * gestureState.dx + gestureState.dy * gestureState.dy);
89
-
90
- // If it was a tap (no significant movement), trigger onPress
91
- if (distance <= 5) {
92
- onPress();
93
- } else {
94
- // Calculate new position after dragging
95
- const newTop = lastPosition.current.top + gestureState.dy;
96
- const newRight = lastPosition.current.right - gestureState.dx;
97
-
98
- // Clamp to screen bounds
99
- const clampedTop = Math.max(screenBounds.minTop, Math.min(screenBounds.maxTop, newTop));
100
- const clampedRight = Math.max(screenBounds.minRight, Math.min(screenBounds.maxRight, newRight));
101
-
102
- // Update position
103
- lastPosition.current = {
104
- top: clampedTop,
105
- right: clampedRight
106
- };
107
- position.setValue({
108
- x: clampedRight,
109
- y: clampedTop
110
- });
111
-
112
- // Convert back to x,y coordinates for storage
113
- const {
114
- width
115
- } = Dimensions.get('window');
116
- const storagePosition = {
117
- x: width - clampedRight - buttonSize,
118
- y: clampedTop
119
- };
120
-
121
- // Persist position to AsyncStorage (debounced)
122
- storageService.saveFloatingButtonPosition(storagePosition);
123
- }
124
- }
125
- })).current;
126
-
127
- // Memoized button icon and color for performance
128
- const content = useMemo(() => {
129
- switch (sessionState) {
130
- case SessionState.started:
131
- return {
132
- icon: /*#__PURE__*/_jsx(CapturingIcon, {
133
- size: 28,
134
- color: "white"
135
- }),
136
- color: '#FF4444'
137
- };
138
- case SessionState.paused:
139
- return {
140
- icon: /*#__PURE__*/_jsx(PausedIcon, {
141
- size: 28,
142
- color: "white"
143
- }),
144
- color: '#FFA500'
145
- };
146
- default:
147
- return {
148
- icon: /*#__PURE__*/_jsx(RecordIcon, {
149
- size: 28,
150
- color: "#718096"
151
- }),
152
- color: '#ffffff'
153
- };
154
- }
155
- }, [sessionState]);
156
- return /*#__PURE__*/_jsx(Animated.View, {
157
- style: [styles.draggableButton, {
158
- top: position.y,
159
- right: position.x
160
- }],
161
- ...panResponder.panHandlers,
162
- children: /*#__PURE__*/_jsx(View, {
163
- style: [styles.floatingButton, {
164
- backgroundColor: content.color
165
- }],
166
- children: content.icon
167
- })
168
- });
169
- };
170
- const styles = StyleSheet.create({
171
- draggableButton: {
172
- position: 'absolute'
173
- },
174
- floatingButton: {
175
- elevation: 8,
176
- shadowRadius: 4,
177
- width: buttonSize,
178
- shadowColor: '#000',
179
- height: buttonSize,
180
- shadowOpacity: 0.25,
181
- alignItems: 'center',
182
- justifyContent: 'center',
183
- borderRadius: buttonSize / 2,
184
- shadowOffset: {
185
- width: 0,
186
- height: 2
187
- }
188
- }
189
- });
190
- export default FloatingButton;
191
- //# sourceMappingURL=FloatingButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useRef","useEffect","useMemo","StyleSheet","Platform","Animated","PanResponder","View","Dimensions","SessionState","StorageService","RecordIcon","CapturingIcon","PausedIcon","jsx","_jsx","buttonSize","rightOffset","topOffset","OS","FloatingButton","sessionState","onPress","position","ValueXY","x","y","current","lastPosition","top","right","storageService","getInstance","screenBounds","width","height","get","minTop","maxTop","minRight","maxRight","savedPosition","getFloatingButtonPosition","setValue","panResponder","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","_","gestureState","distance","Math","sqrt","dx","dy","onPanResponderGrant","onPanResponderMove","newTop","newRight","onPanResponderRelease","clampedTop","max","min","clampedRight","storagePosition","saveFloatingButtonPosition","content","started","icon","size","color","paused","style","styles","draggableButton","panHandlers","children","floatingButton","backgroundColor","elevation","shadowRadius","shadowColor","shadowOpacity","alignItems","justifyContent","borderRadius","shadowOffset"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/FloatingButton.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACzD,SACEC,UAAU,EACVC,QAAQ,EACRC,QAAQ,EACRC,YAAY,EACZC,IAAI,EACJC,UAAU,QACL,cAAc;AACrB,SAASC,YAAY,QAAQ,sBAAa;AAC1C,SAASC,cAAc,QAAQ,mCAAgC;AAC/D,SAASC,UAAU,EAAEC,aAAa,EAAEC,UAAU,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOhE,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,SAAS,GAAGd,QAAQ,CAACe,EAAE,KAAK,KAAK,GAAG,EAAE,GAAG,EAAE;AAEjD,MAAMC,cAA6C,GAAGA,CAAC;EACrDC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAMC,QAAQ,GAAGvB,MAAM,CAAC,IAAIK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