sales-frontend-components 4.0.0 → 4.0.1

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/dist/index.cjs.js CHANGED
@@ -176,6 +176,12 @@ var isClient$1 = () => {
176
176
  return false;
177
177
  }
178
178
  };
179
+ var isAndroidDevice = () => {
180
+ if (isClient$1() === false) {
181
+ return false;
182
+ }
183
+ return /Android/i.test(navigator.userAgent);
184
+ };
179
185
  var _MessageEventManager = class _MessageEventManager2 {
180
186
  constructor() {
181
187
  __publicField(this, "handlers", /* @__PURE__ */ new Map());
@@ -4447,8 +4453,15 @@ async function convertSourceToFile(source, convertType) {
4447
4453
  }
4448
4454
  async function captureNativeDocuments({ pageLimit }) {
4449
4455
  const clampedPageLimit = clampPageLimit(pageLimit);
4450
- logCameraDebug("native documentCapture requested", { pageLimit: clampedPageLimit });
4451
- const response = await salesFrontendBridge.Bridge.native.documentCapture({ pageLimit: clampedPageLimit });
4456
+ const legacyResponseFileType = isAndroidDevice() ? "scheme" : "base64";
4457
+ logCameraDebug("native documentCapture requested", {
4458
+ pageLimit: clampedPageLimit,
4459
+ responseFileType: legacyResponseFileType
4460
+ });
4461
+ const response = await salesFrontendBridge.Bridge.native.documentCapture({
4462
+ pageLimit: clampedPageLimit,
4463
+ responseFileType: legacyResponseFileType
4464
+ });
4452
4465
  if (response.uris && response.uris.length > 0) {
4453
4466
  logCameraDebug("native documentCapture android uris", { count: response.uris.length });
4454
4467
  return response.uris.map((uri) => ({ kind: "scheme", uri }));
@@ -4456,6 +4469,11 @@ async function captureNativeDocuments({ pageLimit }) {
4456
4469
  if (response.sessionId) {
4457
4470
  return pullIosSession(response.sessionId, response.count ?? 0);
4458
4471
  }
4472
+ if (response.uri) {
4473
+ const kind = response.uri.startsWith("data:") ? "base64" : "scheme";
4474
+ logCameraDebug("native documentCapture legacy single uri", { kind });
4475
+ return [{ kind, uri: response.uri }];
4476
+ }
4459
4477
  logCameraDebug("native documentCapture canceled or empty");
4460
4478
  return [];
4461
4479
  }
package/dist/index.esm.js CHANGED
@@ -174,6 +174,12 @@ var isClient$1 = () => {
174
174
  return false;
175
175
  }
176
176
  };
177
+ var isAndroidDevice = () => {
178
+ if (isClient$1() === false) {
179
+ return false;
180
+ }
181
+ return /Android/i.test(navigator.userAgent);
182
+ };
177
183
  var _MessageEventManager = class _MessageEventManager2 {
178
184
  constructor() {
179
185
  __publicField(this, "handlers", /* @__PURE__ */ new Map());
@@ -4445,8 +4451,15 @@ async function convertSourceToFile(source, convertType) {
4445
4451
  }
4446
4452
  async function captureNativeDocuments({ pageLimit }) {
4447
4453
  const clampedPageLimit = clampPageLimit(pageLimit);
4448
- logCameraDebug("native documentCapture requested", { pageLimit: clampedPageLimit });
4449
- const response = await Bridge.native.documentCapture({ pageLimit: clampedPageLimit });
4454
+ const legacyResponseFileType = isAndroidDevice() ? "scheme" : "base64";
4455
+ logCameraDebug("native documentCapture requested", {
4456
+ pageLimit: clampedPageLimit,
4457
+ responseFileType: legacyResponseFileType
4458
+ });
4459
+ const response = await Bridge.native.documentCapture({
4460
+ pageLimit: clampedPageLimit,
4461
+ responseFileType: legacyResponseFileType
4462
+ });
4450
4463
  if (response.uris && response.uris.length > 0) {
4451
4464
  logCameraDebug("native documentCapture android uris", { count: response.uris.length });
4452
4465
  return response.uris.map((uri) => ({ kind: "scheme", uri }));
@@ -4454,6 +4467,11 @@ async function captureNativeDocuments({ pageLimit }) {
4454
4467
  if (response.sessionId) {
4455
4468
  return pullIosSession(response.sessionId, response.count ?? 0);
4456
4469
  }
4470
+ if (response.uri) {
4471
+ const kind = response.uri.startsWith("data:") ? "base64" : "scheme";
4472
+ logCameraDebug("native documentCapture legacy single uri", { kind });
4473
+ return [{ kind, uri: response.uri }];
4474
+ }
4457
4475
  logCameraDebug("native documentCapture canceled or empty");
4458
4476
  return [];
4459
4477
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sales-frontend-components",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -45,13 +45,13 @@
45
45
  "sales-frontend-stores": "0.0.15",
46
46
  "sales-frontend-typescript-config": "0.0.2",
47
47
  "sales-frontend-assets": "0.0.29",
48
- "sales-frontend-api": "1.0.0",
49
- "sales-frontend-design-system": "0.4.0",
50
- "sales-frontend-bridge": "0.1.0",
48
+ "sales-frontend-api": "1.0.1",
49
+ "sales-frontend-design-system": "0.4.1",
50
+ "sales-frontend-bridge": "0.1.1",
51
51
  "sales-frontend-hooks": "0.0.182",
52
52
  "sales-frontend-solution": "0.0.61",
53
53
  "sales-frontend-debug": "0.0.80",
54
- "sales-frontend-headless": "1.0.0",
54
+ "sales-frontend-headless": "1.0.1",
55
55
  "sales-frontend-vitest-config": "0.0.4"
56
56
  },
57
57
  "peerDependencies": {
@@ -59,12 +59,12 @@
59
59
  "react": ">=19.0.0",
60
60
  "react-dom": ">=19.0.0",
61
61
  "react-hook-form": "^7.58.1",
62
- "sales-frontend-api": "1.0.0",
62
+ "sales-frontend-api": "1.0.1",
63
63
  "sales-frontend-assets": "0.0.29",
64
64
  "sales-frontend-stores": "0.0.15",
65
- "sales-frontend-design-system": "0.4.0",
66
- "sales-frontend-bridge": "0.1.0",
67
- "sales-frontend-headless": "1.0.0",
65
+ "sales-frontend-design-system": "0.4.1",
66
+ "sales-frontend-bridge": "0.1.1",
67
+ "sales-frontend-headless": "1.0.1",
68
68
  "sales-frontend-hooks": "0.0.182",
69
69
  "sales-frontend-solution": "0.0.61"
70
70
  },