@authme/identity-verification 2.8.37 → 2.8.38
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/index.cjs +60 -45
- package/index.js +60 -45
- package/package.json +6 -6
package/index.cjs
CHANGED
|
@@ -29092,13 +29092,16 @@ const fasRecognitionResultMapping = fasRecognitionResult => {
|
|
|
29092
29092
|
return (_a = fasServiceStageMap[fasRecognitionResult]) !== null && _a !== void 0 ? _a : core.StatusDescription.Failed;
|
|
29093
29093
|
};
|
|
29094
29094
|
|
|
29095
|
+
/**
|
|
29096
|
+
* 對齊 Android SDK 的 ROI 參數
|
|
29097
|
+
* @see /Users/leoliu/Git/Android/ekyc-sdk-android/AuthMeLiveness/src/main/java/com/authme/lib/liveness/LivenessUseCase.kt
|
|
29098
|
+
*/
|
|
29095
29099
|
var MASK_STYLE;
|
|
29096
29100
|
(function (MASK_STYLE) {
|
|
29097
29101
|
MASK_STYLE[MASK_STYLE["DESKTOP_LIMIT"] = 1024] = "DESKTOP_LIMIT";
|
|
29098
|
-
|
|
29099
|
-
MASK_STYLE[MASK_STYLE["
|
|
29100
|
-
MASK_STYLE[MASK_STYLE["
|
|
29101
|
-
MASK_STYLE[MASK_STYLE["MASK_TOP_PERCENT"] = 25.5] = "MASK_TOP_PERCENT";
|
|
29102
|
+
// Android SDK 參數: widthRatio = 0.7, ratio (height/width) = 1.3
|
|
29103
|
+
MASK_STYLE[MASK_STYLE["WIDTH_RATIO"] = 0.7] = "WIDTH_RATIO";
|
|
29104
|
+
MASK_STYLE[MASK_STYLE["HEIGHT_WIDTH_RATIO"] = 1.3] = "HEIGHT_WIDTH_RATIO";
|
|
29102
29105
|
MASK_STYLE[MASK_STYLE["MASK_TITLE_MARGIN"] = 24] = "MASK_TITLE_MARGIN";
|
|
29103
29106
|
MASK_STYLE[MASK_STYLE["TITLE_TEXT_FONT_SIZE"] = 18] = "TITLE_TEXT_FONT_SIZE";
|
|
29104
29107
|
})(MASK_STYLE || (MASK_STYLE = {}));
|
|
@@ -29123,10 +29126,20 @@ const renderLivenessUI = config => {
|
|
|
29123
29126
|
const faceMask = document.createElement('div');
|
|
29124
29127
|
faceMask.classList.add('face-mask');
|
|
29125
29128
|
config.videoContainer.appendChild(faceMask);
|
|
29126
|
-
//
|
|
29127
|
-
|
|
29128
|
-
const
|
|
29129
|
-
|
|
29129
|
+
// 對齊 Android SDK: 橢圓寬度 = 螢幕寬度 × 0.7, 高度 = 寬度 × 1.3
|
|
29130
|
+
// 橫式螢幕:以高度為基準反推寬度,確保橢圓不會超出螢幕
|
|
29131
|
+
const isLandscape = window.innerWidth > window.innerHeight;
|
|
29132
|
+
let maskWidth;
|
|
29133
|
+
let maskHeight;
|
|
29134
|
+
if (isLandscape) {
|
|
29135
|
+
// 橫式螢幕:以高度為基準
|
|
29136
|
+
maskHeight = window.innerHeight * MASK_STYLE.WIDTH_RATIO;
|
|
29137
|
+
maskWidth = maskHeight / MASK_STYLE.HEIGHT_WIDTH_RATIO;
|
|
29138
|
+
} else {
|
|
29139
|
+
// 直式螢幕:以寬度為基準
|
|
29140
|
+
maskWidth = window.innerWidth * MASK_STYLE.WIDTH_RATIO;
|
|
29141
|
+
maskHeight = maskWidth * MASK_STYLE.HEIGHT_WIDTH_RATIO;
|
|
29142
|
+
}
|
|
29130
29143
|
faceMask.style.width = `${maskWidth}px`;
|
|
29131
29144
|
faceMask.style.height = `${maskHeight}px`;
|
|
29132
29145
|
faceMask.style.setProperty('--authme-liveness-scanner-pass-color', uiThemeConfig.livenessSuccessScanFrame.color);
|
|
@@ -29151,8 +29164,11 @@ const renderLivenessUI = config => {
|
|
|
29151
29164
|
if (uiThemeConfig.isStatementEnabled) {
|
|
29152
29165
|
config.videoContainer.appendChild(statementContainer);
|
|
29153
29166
|
}
|
|
29154
|
-
|
|
29155
|
-
|
|
29167
|
+
// 根據橢圓大小動態計算文字位置,避免壓到橢圓
|
|
29168
|
+
// titleThree (direction: bottom) - 值越小越靠近底部
|
|
29169
|
+
// hint (direction: top) - 值越大越往下
|
|
29170
|
+
util.uiThemeText(titleText, uiThemeConfig.titleThree, '-2vh');
|
|
29171
|
+
util.uiThemeHint(statusText, uiThemeConfig.hint, '7vh');
|
|
29156
29172
|
// Set init text
|
|
29157
29173
|
titleText.textContent = translateService.translate('sdk.liveness.detection.step');
|
|
29158
29174
|
statusText.textContent = translateService.translate('sdk.general.verify.error.noFace');
|
|
@@ -34604,40 +34620,39 @@ class LivenessModule {
|
|
|
34604
34620
|
frameWidth = canvasSizeInfoCan.canvasWidth;
|
|
34605
34621
|
frameHeight = canvasSizeInfoCan.canvasHeight;
|
|
34606
34622
|
const params = yield this.fasService.getParams();
|
|
34607
|
-
|
|
34608
|
-
|
|
34609
|
-
|
|
34610
|
-
|
|
34611
|
-
|
|
34612
|
-
|
|
34613
|
-
|
|
34614
|
-
|
|
34615
|
-
|
|
34616
|
-
|
|
34617
|
-
|
|
34618
|
-
|
|
34619
|
-
|
|
34620
|
-
|
|
34621
|
-
|
|
34622
|
-
|
|
34623
|
-
|
|
34624
|
-
//
|
|
34625
|
-
|
|
34626
|
-
|
|
34627
|
-
|
|
34628
|
-
|
|
34629
|
-
|
|
34630
|
-
|
|
34631
|
-
}
|
|
34632
|
-
// 如果計算出的寬度比例大於1,表示需要裁剪寬度
|
|
34633
|
-
else {
|
|
34634
|
-
// 維持完整的寬度,但可能需要調整其他參數以保持9:16的比例
|
|
34635
|
-
params.faceROI.fLeft = 0;
|
|
34636
|
-
params.faceROI.fRight = 1;
|
|
34637
|
-
// 這裡可能需要調整垂直方向的ROI,根據實際需求添加
|
|
34638
|
-
}
|
|
34623
|
+
/**
|
|
34624
|
+
* 對齊 Android SDK 的 ROI 參數
|
|
34625
|
+
* @see /Users/leoliu/Git/Android/ekyc-sdk-android/AuthMeLiveness/src/main/java/com/authme/lib/liveness/LivenessUseCase.kt
|
|
34626
|
+
*
|
|
34627
|
+
* Android SDK 參數:
|
|
34628
|
+
* - widthRatio = 0.7 (ROI 寬度 = 螢幕寬度 × 0.7)
|
|
34629
|
+
* - ratio = 1.3 (ROI 高度 = ROI 寬度 × 1.3)
|
|
34630
|
+
*
|
|
34631
|
+
* 橫式螢幕處理:以高度為基準反推寬度,確保橢圓不會超出螢幕
|
|
34632
|
+
*/
|
|
34633
|
+
const WIDTH_RATIO = 0.7;
|
|
34634
|
+
const HEIGHT_WIDTH_RATIO = 1.3;
|
|
34635
|
+
const isLandscape = frameWidth > frameHeight;
|
|
34636
|
+
let ellipseWidth;
|
|
34637
|
+
let ellipseHeight;
|
|
34638
|
+
if (isLandscape) {
|
|
34639
|
+
// 橫式螢幕:以高度為基準,反推寬度
|
|
34640
|
+
// 橢圓高度最多佔螢幕高度的 70%,然後反推寬度
|
|
34641
|
+
ellipseHeight = frameHeight * WIDTH_RATIO;
|
|
34642
|
+
ellipseWidth = ellipseHeight / HEIGHT_WIDTH_RATIO;
|
|
34643
|
+
} else {
|
|
34644
|
+
// 直式螢幕:以寬度為基準(對齊 Android SDK)
|
|
34645
|
+
ellipseWidth = frameWidth * WIDTH_RATIO;
|
|
34646
|
+
ellipseHeight = ellipseWidth * HEIGHT_WIDTH_RATIO;
|
|
34639
34647
|
}
|
|
34640
|
-
|
|
34648
|
+
// 計算正規化 ROI (0-1 範圍)
|
|
34649
|
+
const widthPercent = ellipseWidth / frameWidth;
|
|
34650
|
+
const heightPercent = ellipseHeight / frameHeight;
|
|
34651
|
+
// 置中計算
|
|
34652
|
+
params.faceROI.fLeft = (1 - widthPercent) / 2;
|
|
34653
|
+
params.faceROI.fRight = 1 - (1 - widthPercent) / 2;
|
|
34654
|
+
params.faceROI.fTop = (1 - heightPercent) / 2;
|
|
34655
|
+
params.faceROI.fBottom = 1 - (1 - heightPercent) / 2;
|
|
34641
34656
|
yield this.fasService.setParams(params);
|
|
34642
34657
|
yield this.fasService.setFrameSize(frameWidth, frameHeight);
|
|
34643
34658
|
yield this.fasService.startSession();
|
|
@@ -37328,8 +37343,8 @@ class AuthmeIdentityVerification extends engine.AuthmeFunctionModule {
|
|
|
37328
37343
|
}
|
|
37329
37344
|
|
|
37330
37345
|
var name = "authme/sdk";
|
|
37331
|
-
var version$1 = "2.8.
|
|
37332
|
-
var date = "
|
|
37346
|
+
var version$1 = "2.8.38";
|
|
37347
|
+
var date = "2026-01-21T02:32:26+0000";
|
|
37333
37348
|
var packageInfo = {
|
|
37334
37349
|
name: name,
|
|
37335
37350
|
version: version$1,
|
package/index.js
CHANGED
|
@@ -29084,13 +29084,16 @@ const fasRecognitionResultMapping = fasRecognitionResult => {
|
|
|
29084
29084
|
return (_a = fasServiceStageMap[fasRecognitionResult]) !== null && _a !== void 0 ? _a : StatusDescription.Failed;
|
|
29085
29085
|
};
|
|
29086
29086
|
|
|
29087
|
+
/**
|
|
29088
|
+
* 對齊 Android SDK 的 ROI 參數
|
|
29089
|
+
* @see /Users/leoliu/Git/Android/ekyc-sdk-android/AuthMeLiveness/src/main/java/com/authme/lib/liveness/LivenessUseCase.kt
|
|
29090
|
+
*/
|
|
29087
29091
|
var MASK_STYLE;
|
|
29088
29092
|
(function (MASK_STYLE) {
|
|
29089
29093
|
MASK_STYLE[MASK_STYLE["DESKTOP_LIMIT"] = 1024] = "DESKTOP_LIMIT";
|
|
29090
|
-
|
|
29091
|
-
MASK_STYLE[MASK_STYLE["
|
|
29092
|
-
MASK_STYLE[MASK_STYLE["
|
|
29093
|
-
MASK_STYLE[MASK_STYLE["MASK_TOP_PERCENT"] = 25.5] = "MASK_TOP_PERCENT";
|
|
29094
|
+
// Android SDK 參數: widthRatio = 0.7, ratio (height/width) = 1.3
|
|
29095
|
+
MASK_STYLE[MASK_STYLE["WIDTH_RATIO"] = 0.7] = "WIDTH_RATIO";
|
|
29096
|
+
MASK_STYLE[MASK_STYLE["HEIGHT_WIDTH_RATIO"] = 1.3] = "HEIGHT_WIDTH_RATIO";
|
|
29094
29097
|
MASK_STYLE[MASK_STYLE["MASK_TITLE_MARGIN"] = 24] = "MASK_TITLE_MARGIN";
|
|
29095
29098
|
MASK_STYLE[MASK_STYLE["TITLE_TEXT_FONT_SIZE"] = 18] = "TITLE_TEXT_FONT_SIZE";
|
|
29096
29099
|
})(MASK_STYLE || (MASK_STYLE = {}));
|
|
@@ -29115,10 +29118,20 @@ const renderLivenessUI = config => {
|
|
|
29115
29118
|
const faceMask = document.createElement('div');
|
|
29116
29119
|
faceMask.classList.add('face-mask');
|
|
29117
29120
|
config.videoContainer.appendChild(faceMask);
|
|
29118
|
-
//
|
|
29119
|
-
|
|
29120
|
-
const
|
|
29121
|
-
|
|
29121
|
+
// 對齊 Android SDK: 橢圓寬度 = 螢幕寬度 × 0.7, 高度 = 寬度 × 1.3
|
|
29122
|
+
// 橫式螢幕:以高度為基準反推寬度,確保橢圓不會超出螢幕
|
|
29123
|
+
const isLandscape = window.innerWidth > window.innerHeight;
|
|
29124
|
+
let maskWidth;
|
|
29125
|
+
let maskHeight;
|
|
29126
|
+
if (isLandscape) {
|
|
29127
|
+
// 橫式螢幕:以高度為基準
|
|
29128
|
+
maskHeight = window.innerHeight * MASK_STYLE.WIDTH_RATIO;
|
|
29129
|
+
maskWidth = maskHeight / MASK_STYLE.HEIGHT_WIDTH_RATIO;
|
|
29130
|
+
} else {
|
|
29131
|
+
// 直式螢幕:以寬度為基準
|
|
29132
|
+
maskWidth = window.innerWidth * MASK_STYLE.WIDTH_RATIO;
|
|
29133
|
+
maskHeight = maskWidth * MASK_STYLE.HEIGHT_WIDTH_RATIO;
|
|
29134
|
+
}
|
|
29122
29135
|
faceMask.style.width = `${maskWidth}px`;
|
|
29123
29136
|
faceMask.style.height = `${maskHeight}px`;
|
|
29124
29137
|
faceMask.style.setProperty('--authme-liveness-scanner-pass-color', uiThemeConfig.livenessSuccessScanFrame.color);
|
|
@@ -29143,8 +29156,11 @@ const renderLivenessUI = config => {
|
|
|
29143
29156
|
if (uiThemeConfig.isStatementEnabled) {
|
|
29144
29157
|
config.videoContainer.appendChild(statementContainer);
|
|
29145
29158
|
}
|
|
29146
|
-
|
|
29147
|
-
|
|
29159
|
+
// 根據橢圓大小動態計算文字位置,避免壓到橢圓
|
|
29160
|
+
// titleThree (direction: bottom) - 值越小越靠近底部
|
|
29161
|
+
// hint (direction: top) - 值越大越往下
|
|
29162
|
+
uiThemeText(titleText, uiThemeConfig.titleThree, '-2vh');
|
|
29163
|
+
uiThemeHint(statusText, uiThemeConfig.hint, '7vh');
|
|
29148
29164
|
// Set init text
|
|
29149
29165
|
titleText.textContent = translateService.translate('sdk.liveness.detection.step');
|
|
29150
29166
|
statusText.textContent = translateService.translate('sdk.general.verify.error.noFace');
|
|
@@ -34596,40 +34612,39 @@ class LivenessModule {
|
|
|
34596
34612
|
frameWidth = canvasSizeInfoCan.canvasWidth;
|
|
34597
34613
|
frameHeight = canvasSizeInfoCan.canvasHeight;
|
|
34598
34614
|
const params = yield this.fasService.getParams();
|
|
34599
|
-
|
|
34600
|
-
|
|
34601
|
-
|
|
34602
|
-
|
|
34603
|
-
|
|
34604
|
-
|
|
34605
|
-
|
|
34606
|
-
|
|
34607
|
-
|
|
34608
|
-
|
|
34609
|
-
|
|
34610
|
-
|
|
34611
|
-
|
|
34612
|
-
|
|
34613
|
-
|
|
34614
|
-
|
|
34615
|
-
|
|
34616
|
-
//
|
|
34617
|
-
|
|
34618
|
-
|
|
34619
|
-
|
|
34620
|
-
|
|
34621
|
-
|
|
34622
|
-
|
|
34623
|
-
}
|
|
34624
|
-
// 如果計算出的寬度比例大於1,表示需要裁剪寬度
|
|
34625
|
-
else {
|
|
34626
|
-
// 維持完整的寬度,但可能需要調整其他參數以保持9:16的比例
|
|
34627
|
-
params.faceROI.fLeft = 0;
|
|
34628
|
-
params.faceROI.fRight = 1;
|
|
34629
|
-
// 這裡可能需要調整垂直方向的ROI,根據實際需求添加
|
|
34630
|
-
}
|
|
34615
|
+
/**
|
|
34616
|
+
* 對齊 Android SDK 的 ROI 參數
|
|
34617
|
+
* @see /Users/leoliu/Git/Android/ekyc-sdk-android/AuthMeLiveness/src/main/java/com/authme/lib/liveness/LivenessUseCase.kt
|
|
34618
|
+
*
|
|
34619
|
+
* Android SDK 參數:
|
|
34620
|
+
* - widthRatio = 0.7 (ROI 寬度 = 螢幕寬度 × 0.7)
|
|
34621
|
+
* - ratio = 1.3 (ROI 高度 = ROI 寬度 × 1.3)
|
|
34622
|
+
*
|
|
34623
|
+
* 橫式螢幕處理:以高度為基準反推寬度,確保橢圓不會超出螢幕
|
|
34624
|
+
*/
|
|
34625
|
+
const WIDTH_RATIO = 0.7;
|
|
34626
|
+
const HEIGHT_WIDTH_RATIO = 1.3;
|
|
34627
|
+
const isLandscape = frameWidth > frameHeight;
|
|
34628
|
+
let ellipseWidth;
|
|
34629
|
+
let ellipseHeight;
|
|
34630
|
+
if (isLandscape) {
|
|
34631
|
+
// 橫式螢幕:以高度為基準,反推寬度
|
|
34632
|
+
// 橢圓高度最多佔螢幕高度的 70%,然後反推寬度
|
|
34633
|
+
ellipseHeight = frameHeight * WIDTH_RATIO;
|
|
34634
|
+
ellipseWidth = ellipseHeight / HEIGHT_WIDTH_RATIO;
|
|
34635
|
+
} else {
|
|
34636
|
+
// 直式螢幕:以寬度為基準(對齊 Android SDK)
|
|
34637
|
+
ellipseWidth = frameWidth * WIDTH_RATIO;
|
|
34638
|
+
ellipseHeight = ellipseWidth * HEIGHT_WIDTH_RATIO;
|
|
34631
34639
|
}
|
|
34632
|
-
|
|
34640
|
+
// 計算正規化 ROI (0-1 範圍)
|
|
34641
|
+
const widthPercent = ellipseWidth / frameWidth;
|
|
34642
|
+
const heightPercent = ellipseHeight / frameHeight;
|
|
34643
|
+
// 置中計算
|
|
34644
|
+
params.faceROI.fLeft = (1 - widthPercent) / 2;
|
|
34645
|
+
params.faceROI.fRight = 1 - (1 - widthPercent) / 2;
|
|
34646
|
+
params.faceROI.fTop = (1 - heightPercent) / 2;
|
|
34647
|
+
params.faceROI.fBottom = 1 - (1 - heightPercent) / 2;
|
|
34633
34648
|
yield this.fasService.setParams(params);
|
|
34634
34649
|
yield this.fasService.setFrameSize(frameWidth, frameHeight);
|
|
34635
34650
|
yield this.fasService.startSession();
|
|
@@ -37320,8 +37335,8 @@ class AuthmeIdentityVerification extends AuthmeFunctionModule {
|
|
|
37320
37335
|
}
|
|
37321
37336
|
|
|
37322
37337
|
var name = "authme/sdk";
|
|
37323
|
-
var version$1 = "2.8.
|
|
37324
|
-
var date = "
|
|
37338
|
+
var version$1 = "2.8.38";
|
|
37339
|
+
var date = "2026-01-21T02:32:26+0000";
|
|
37325
37340
|
var packageInfo = {
|
|
37326
37341
|
name: name,
|
|
37327
37342
|
version: version$1,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authme/identity-verification",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.38",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"core-js": "^3.6.0",
|
|
6
6
|
"lottie-web": "^5.9.2",
|
|
7
7
|
"rxjs": "^7.4.0",
|
|
8
|
-
"@authme/core": "2.8.
|
|
9
|
-
"@authme/engine": "2.8.
|
|
10
|
-
"@authme/id-recognition": "2.8.
|
|
11
|
-
"@authme/liveness": "2.8.
|
|
12
|
-
"@authme/util": "2.8.
|
|
8
|
+
"@authme/core": "2.8.38",
|
|
9
|
+
"@authme/engine": "2.8.38",
|
|
10
|
+
"@authme/id-recognition": "2.8.38",
|
|
11
|
+
"@authme/liveness": "2.8.38",
|
|
12
|
+
"@authme/util": "2.8.38"
|
|
13
13
|
},
|
|
14
14
|
"module": "./index.js",
|
|
15
15
|
"main": "./index.cjs",
|