@regulaforensics/idv 3.10.264-rc → 3.10.265-nightly

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.
@@ -7,11 +7,11 @@
7
7
  "postinstall": "patch-package"
8
8
  },
9
9
  "dependencies": {
10
- "@regulaforensics/idv": "3.10.264-rc",
11
- "@regulaforensics/idv-module-document-reader": "3.10.384-rc",
12
- "@regulaforensics/idv-module-face": "3.10.385-rc",
13
- "@regulaforensics/document-reader-core-fullauthrfid": "9.10.3412-rc",
14
- "@regulaforensics/face-core-basic": "8.5.906-rc",
10
+ "@regulaforensics/idv": "3.10.265-nightly",
11
+ "@regulaforensics/idv-module-document-reader": "3.10.386-nightly",
12
+ "@regulaforensics/idv-module-face": "3.10.387-nightly",
13
+ "@regulaforensics/document-reader-core-fullauthrfid": "9.10.3411-nightly",
14
+ "@regulaforensics/face-core-basic": "8.5.907-nightly",
15
15
  "@angular-devkit/build-angular": "^22.1.8",
16
16
  "@angular/cli": "^22.1.8",
17
17
  "@angular/common": "^22.1.7",
@@ -32,8 +32,10 @@
32
32
  "typescript": "~6.0.3"
33
33
  },
34
34
  "overrides": {
35
- "serialize-javascript": "^7.1.1",
36
- "uuid": "^11.1.1"
35
+ "serialize-javascript": "^7.1.2",
36
+ "uuid": "^11.1.1",
37
+ "source-map-js": "^1.2.2",
38
+ "shell-quote": "^1.11.0"
37
39
  },
38
40
  "cordova": {
39
41
  "plugins": {
@@ -36,17 +36,19 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
36
36
  },
37
37
  plugins: [
38
38
  '@regulaforensics/idv',
39
+ './scripts/withoutMetroServer',
39
40
  ['expo-custom-assets', { assetsPaths: ['./assets'] }],
40
41
  ['expo-build-properties', {
42
+ ios: { networkInspector: false },
41
43
  android: {
44
+ networkInspector: false,
42
45
  extraMavenRepos: [
43
46
  { url: 'https://maven.regulaforensics.com/RegulaDocumentReader' },
44
47
  { url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Beta' },
45
48
  { url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Nightly' },
46
49
  { url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Stage' }
47
50
  ]
48
- },
49
- ios: { networkInspector: false }
51
+ }
50
52
  }]
51
53
  ]
52
54
  })
@@ -1,6 +1,8 @@
1
1
  import { registerRootComponent } from 'expo'
2
2
  import WebView from 'react-native-webview'
3
3
  import React from 'react'
4
+ import * as RNFS from 'react-native-fs'
5
+ import { Platform } from 'react-native'
4
6
  import { main } from './src/main'
5
7
 
6
8
  var webViewRef: any
@@ -47,17 +49,45 @@ const document = {
47
49
  }
48
50
 
49
51
  function parseValue(value: any) {
50
- if (value !== true && value !== false) return `"${value}"`
51
- return value
52
+ const json = JSON.stringify(value)
53
+ return typeof value === 'string' ? `(window.webImages[${json}] ?? ${json})` : json
54
+ }
55
+
56
+ async function loadWebUI() {
57
+ const webRoot = Platform.OS === 'ios' ? RNFS.MainBundlePath + '/web/' : 'web/'
58
+ const readWebFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileAssets
59
+ const readWebDir = Platform.OS === 'ios' ? RNFS.readDir : RNFS.readDirAssets
60
+ const webImages: Record<string, string> = {}
61
+ const [styles, content] = await Promise.all(['src/main.css', 'src/main.html'].map(path => readWebFile(webRoot + path, 'utf8')))
62
+
63
+ for (const file of (await readWebDir(webRoot + 'images')).filter(file => file.isFile())) {
64
+ const extension = file.name.split('.').pop()!.toLowerCase()
65
+ const type = ({ jpg: 'jpeg', svg: 'svg+xml' } as Record<string, string>)[extension] ?? extension
66
+ webImages['images/' + file.name] = `data:image/${type};base64,${await readWebFile(file.path, 'base64')}`
67
+ }
68
+
69
+ const html = content.replace(/src="([^"]+)"/g, (match, path) => webImages[path] ? `src="${webImages[path]}"` : match)
70
+ return `<meta name="viewport" content="initial-scale=1, user-scalable=no, viewport-fit=cover">
71
+ <style>${styles}</style>
72
+ <div id="content" style="height: 100%">${html}</div>
73
+ <script>
74
+ window.webImages = ${JSON.stringify(webImages)};
75
+ requestAnimationFrame(() => requestAnimationFrame(() => {
76
+ window.ReactNativeWebView.postMessage(JSON.stringify({ id: "ready" }))
77
+ }))
78
+ </script>`
52
79
  }
53
80
 
54
81
  (globalThis as any).document = document;
55
- registerRootComponent(() =>
56
- <WebView
82
+ registerRootComponent(() => {
83
+ const [html, setHtml] = React.useState('')
84
+ React.useEffect(() => { loadWebUI().then(setHtml).catch(console.error) }, [])
85
+ return html ? <WebView
57
86
  ref={ref => { webViewRef = ref }}
58
87
  onMessage={onMessage}
59
- source={require("./index.html")}
88
+ originWhitelist={['*']}
89
+ source={{ html }}
60
90
  scrollEnabled={false}
61
91
  overScrollMode={'content'}
62
- />
63
- )
92
+ /> : null
93
+ })
@@ -1,7 +1,5 @@
1
1
  const config = require('expo/metro-config').getDefaultConfig(__dirname)
2
2
  config.watchFolders = [
3
- __dirname + '/node_modules'
4
3
  ]
5
- config.resolver.nodeModulesPaths = config.watchFolders
6
- config.resolver.assetExts.push('css')
4
+ config.resolver.nodeModulesPaths = [__dirname + '/node_modules']
7
5
  module.exports = config