@authme/identity-verification 2.8.32 → 2.8.33
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 +52 -25
- package/index.js +52 -25
- package/package.json +6 -6
- package/src/lib/ui/ocr.animate.d.ts +2 -2
package/index.cjs
CHANGED
|
@@ -30707,7 +30707,7 @@ function makeStyleTag(styleSetting) {
|
|
|
30707
30707
|
`;
|
|
30708
30708
|
return newStyle;
|
|
30709
30709
|
}
|
|
30710
|
-
function renderCardRotateAnimate(container) {
|
|
30710
|
+
function renderCardRotateAnimate(container, directionTextPanel = null, setAnimationFrameState) {
|
|
30711
30711
|
let animateStop = true;
|
|
30712
30712
|
let stopTimeout = null;
|
|
30713
30713
|
let currentDirection = null;
|
|
@@ -30727,6 +30727,10 @@ function renderCardRotateAnimate(container) {
|
|
|
30727
30727
|
frontArrowSvg.style.zIndex = `var(--authme-layers-2-z-index)`;
|
|
30728
30728
|
cardSvg.appendChild(cardMainGroup);
|
|
30729
30729
|
div.appendChild(cardSvg);
|
|
30730
|
+
// Append directionTextPanel to div.arrow if provided
|
|
30731
|
+
if (directionTextPanel) {
|
|
30732
|
+
div.appendChild(directionTextPanel);
|
|
30733
|
+
}
|
|
30730
30734
|
cardSvg.style.display = 'none';
|
|
30731
30735
|
frontArrowSvg.style.display = 'none';
|
|
30732
30736
|
backArrowSvg.style.display = 'none';
|
|
@@ -31063,9 +31067,8 @@ function renderCardRotateAnimate(container) {
|
|
|
31063
31067
|
}, roundAnimateDuration);
|
|
31064
31068
|
});
|
|
31065
31069
|
}
|
|
31066
|
-
function fadeAnimate(inOrOut
|
|
31070
|
+
function fadeAnimate(inOrOut) {
|
|
31067
31071
|
div.style.opacity = inOrOut === 'in' ? '0.8' : '0';
|
|
31068
|
-
if (directionTextPanel) directionTextPanel.style.display = inOrOut === 'in' ? 'flex' : 'none';
|
|
31069
31072
|
return new Promise(resolve => {
|
|
31070
31073
|
setTimeout(() => {
|
|
31071
31074
|
resolve(true);
|
|
@@ -31074,15 +31077,23 @@ function renderCardRotateAnimate(container) {
|
|
|
31074
31077
|
}
|
|
31075
31078
|
function rotateCard(direction, beforeAnimate = () => {
|
|
31076
31079
|
return;
|
|
31077
|
-
},
|
|
31080
|
+
}, stopOn = -1) {
|
|
31078
31081
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31079
31082
|
// console.log('rotateCard', direction);
|
|
31080
31083
|
animateStop = false;
|
|
31084
|
+
// 停止送圖(動畫開始)
|
|
31085
|
+
if (setAnimationFrameState) {
|
|
31086
|
+
setAnimationFrameState(true);
|
|
31087
|
+
}
|
|
31081
31088
|
stopTimeout = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
31082
31089
|
if (animateStop) return;
|
|
31083
|
-
yield fadeAnimate('out'
|
|
31090
|
+
yield fadeAnimate('out');
|
|
31084
31091
|
setTimeout(() => {
|
|
31085
31092
|
resetAnimateStatus();
|
|
31093
|
+
// 恢復送圖(動畫結束)
|
|
31094
|
+
if (setAnimationFrameState) {
|
|
31095
|
+
setAnimationFrameState(false);
|
|
31096
|
+
}
|
|
31086
31097
|
}, fadeDuration);
|
|
31087
31098
|
beforeAnimate();
|
|
31088
31099
|
}), stopOn === -1 ? roundAnimateDuration * 2 : stopOn);
|
|
@@ -31091,7 +31102,7 @@ function renderCardRotateAnimate(container) {
|
|
|
31091
31102
|
cardSvg.style.display = 'block';
|
|
31092
31103
|
frontArrowSvg.style.display = 'block';
|
|
31093
31104
|
backArrowSvg.style.display = 'block';
|
|
31094
|
-
yield fadeAnimate('in'
|
|
31105
|
+
yield fadeAnimate('in');
|
|
31095
31106
|
function _rotateCard(direction) {
|
|
31096
31107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31097
31108
|
switch (direction) {
|
|
@@ -32617,7 +32628,7 @@ function startOCR(config) {
|
|
|
32617
32628
|
if (type !== idRecognition.EAuthMeCardClass.TWN_IDCard_Front || !config.ocrConfig.needAntiFraud) {
|
|
32618
32629
|
return rxjs.of(true);
|
|
32619
32630
|
}
|
|
32620
|
-
const applyTextByResult = result => {
|
|
32631
|
+
const applyTextByResult = result => __awaiter(this, void 0, void 0, function* () {
|
|
32621
32632
|
if (!uiComponentOCRMask.setCardBorderColor) return;
|
|
32622
32633
|
uiComponentOCR.statusText.classList.add('non-empty');
|
|
32623
32634
|
switch (result.eStatus) {
|
|
@@ -32705,13 +32716,11 @@ function startOCR(config) {
|
|
|
32705
32716
|
break;
|
|
32706
32717
|
case idRecognition.EAuthMeIDCardAntiFraudStatus.StagePass:
|
|
32707
32718
|
uiComponentOCR.statusText.textContent = translateService.translate('sdk.general.verify.error.stagePass');
|
|
32708
|
-
stopAnimate();
|
|
32709
32719
|
previosAntiFraudAnimateTime = Date.now();
|
|
32710
32720
|
uiComponentOCRMask.setCardBorderColor('pass');
|
|
32711
|
-
//
|
|
32712
|
-
|
|
32713
|
-
|
|
32714
|
-
}, 2000);
|
|
32721
|
+
// Block execution for 2 seconds to show StagePass state
|
|
32722
|
+
yield new Promise(resolve => setTimeout(resolve, 2000));
|
|
32723
|
+
stopAnimate();
|
|
32715
32724
|
break;
|
|
32716
32725
|
case idRecognition.EAuthMeIDCardAntiFraudStatus.Pass:
|
|
32717
32726
|
uiComponentOCRMask.setCardBorderColor('pass');
|
|
@@ -32739,8 +32748,12 @@ function startOCR(config) {
|
|
|
32739
32748
|
uiComponentOCR.statusText.textContent = '';
|
|
32740
32749
|
uiComponentOCR.statusText.classList.remove('non-empty');
|
|
32741
32750
|
}
|
|
32742
|
-
};
|
|
32743
|
-
const antiFraudStart$ = rxjs.of(true).pipe(rxjs.switchMap(() => util.checkOnlineStatus(translateService.translate('sdk.general.error.alert.offline'), translateService.translate('sdk.general.error.retry'))), rxjs.switchMap(() => canvasSizeInfo$), rxjs.switchMap(canvasSizeInfo => rxjs.from(config.setFrameSize(canvasSizeInfo.canvasWidth, canvasSizeInfo.canvasHeight)).pipe(rxjs.switchMap(() =>
|
|
32751
|
+
});
|
|
32752
|
+
const antiFraudStart$ = rxjs.of(true).pipe(rxjs.switchMap(() => util.checkOnlineStatus(translateService.translate('sdk.general.error.alert.offline'), translateService.translate('sdk.general.error.retry'))), rxjs.switchMap(() => canvasSizeInfo$), rxjs.switchMap(canvasSizeInfo => rxjs.from(config.setFrameSize(canvasSizeInfo.canvasWidth, canvasSizeInfo.canvasHeight)).pipe(rxjs.switchMap(() => {
|
|
32753
|
+
// 動畫開始時停止送圖
|
|
32754
|
+
ocrSendFrameAnimation = true;
|
|
32755
|
+
return config.antiFraudStart(getCardBorderPoint(), uiComponentOCRMask.setBorderType, uiComponentOCRMask.setCardBorderColor, uiComponentOCRMask.setBorderSuccess, uiComponentOCR.scanAnimationContainer, uiComponentOCR.successContainer, uiComponentOCRMask.frameImage, uiComponentOCRMask.frameText, facingMode);
|
|
32756
|
+
}), rxjs.tap(() => __awaiter(this, void 0, void 0, function* () {
|
|
32744
32757
|
setStatusView(core.StatusView.Aligning);
|
|
32745
32758
|
if (buttonDisable$) {
|
|
32746
32759
|
const cardMatchROI = config.getCardMatchROI ? yield config.getCardMatchROI() : undefined;
|
|
@@ -32750,8 +32763,18 @@ function startOCR(config) {
|
|
|
32750
32763
|
countDownTime = new Date().getTime() + ocrEngineConfig.expiredIn * util.TIME_UNIT.SECOND;
|
|
32751
32764
|
sdkFlowTimeout = makeSDKFlowTimeout(ocrEngineConfig.expiredIn);
|
|
32752
32765
|
}
|
|
32753
|
-
})),
|
|
32754
|
-
|
|
32766
|
+
})),
|
|
32767
|
+
// 反欺詐完成後恢復送圖
|
|
32768
|
+
rxjs.tap(() => {
|
|
32769
|
+
ocrSendFrameAnimation = false;
|
|
32770
|
+
}), sendFrame(canvasSizeInfo, uiComponentOCR.image, uiComponentBasic.video, config.onAntiFraudFrame, ocrEngineConfig.fraudMaxFps, false, 'jpg', undefined,
|
|
32771
|
+
// 使用 sendFrame 內建的 flags 機制來控制動畫時的送圖
|
|
32772
|
+
{
|
|
32773
|
+
get animating() {
|
|
32774
|
+
return ocrSendFrameAnimation;
|
|
32775
|
+
}
|
|
32776
|
+
}), rxjs.map(x => x.result), rxjs.concatMap(x => __awaiter(this, void 0, void 0, function* () {
|
|
32777
|
+
yield applyTextByResult(x);
|
|
32755
32778
|
cardRotateByStage(x.eStage);
|
|
32756
32779
|
if (isTutorialFinish) {
|
|
32757
32780
|
cardRotateTextProcess(x.eStage, eStage != x.eStage);
|
|
@@ -32765,7 +32788,8 @@ function startOCR(config) {
|
|
|
32765
32788
|
// if (config.ocrConfig.disableTutorial) {
|
|
32766
32789
|
util.stopSpinner();
|
|
32767
32790
|
}
|
|
32768
|
-
|
|
32791
|
+
return x;
|
|
32792
|
+
})),
|
|
32769
32793
|
// ocrEngineConfig.expiredIn
|
|
32770
32794
|
// ? timeout(ocrEngineConfig.expiredIn * TIME_UNIT.SECOND)
|
|
32771
32795
|
// : tap(),
|
|
@@ -32988,7 +33012,6 @@ function startOCR(config) {
|
|
|
32988
33012
|
}));
|
|
32989
33013
|
};
|
|
32990
33014
|
uiComponentOCRMask.setCardBorderColor(null);
|
|
32991
|
-
let ocrSendFrameAnimation = false;
|
|
32992
33015
|
const handleOcrSendFrame = (canvasSizeInfo, canvas, video, frameCallback, fps, bas64Format, imageType, cardType, type) => source$ => {
|
|
32993
33016
|
let received = true;
|
|
32994
33017
|
const ctx = canvas.getContext('2d', {
|
|
@@ -33086,6 +33109,7 @@ function startOCR(config) {
|
|
|
33086
33109
|
};
|
|
33087
33110
|
return recognition(false);
|
|
33088
33111
|
}
|
|
33112
|
+
let ocrSendFrameAnimation = false;
|
|
33089
33113
|
function createFlowByType(type, cardType, cardTypeConfig) {
|
|
33090
33114
|
return rxjs.of(true).pipe(rxjs.tap(() => {
|
|
33091
33115
|
currentType('set', {
|
|
@@ -33213,7 +33237,10 @@ function startOCR(config) {
|
|
|
33213
33237
|
})),
|
|
33214
33238
|
container: uiComponentBasic.videoContainer
|
|
33215
33239
|
});
|
|
33216
|
-
const rotateUI = renderCardRotateAnimate(uiComponentOCR.arrowAnimationContainer
|
|
33240
|
+
const rotateUI = renderCardRotateAnimate(uiComponentOCR.arrowAnimationContainer, uiComponentOCR.directionTextPanel, isAnimating => {
|
|
33241
|
+
// 動畫開始時停止送圖,動畫結束時恢復送圖
|
|
33242
|
+
ocrSendFrameAnimation = isAnimating;
|
|
33243
|
+
});
|
|
33217
33244
|
rotateCard = rotateUI.rotateCard;
|
|
33218
33245
|
getIsRotateCardAnimating = rotateUI.getIsRotateCardAnimating;
|
|
33219
33246
|
stopAnimate = rotateUI.stopAnimate;
|
|
@@ -33766,22 +33793,22 @@ function startOCR(config) {
|
|
|
33766
33793
|
case idRecognition.EAuthMeIDCardAntiFraudStage.Left:
|
|
33767
33794
|
rotateCard(facingMode === 'front' ? 'right' : 'left', () => {
|
|
33768
33795
|
previosAntiFraudAnimateTime = Date.now();
|
|
33769
|
-
}
|
|
33796
|
+
});
|
|
33770
33797
|
break;
|
|
33771
33798
|
case idRecognition.EAuthMeIDCardAntiFraudStage.Right:
|
|
33772
33799
|
rotateCard(facingMode === 'front' ? 'left' : 'right', () => {
|
|
33773
33800
|
previosAntiFraudAnimateTime = Date.now();
|
|
33774
|
-
}
|
|
33801
|
+
});
|
|
33775
33802
|
break;
|
|
33776
33803
|
case idRecognition.EAuthMeIDCardAntiFraudStage.Up:
|
|
33777
33804
|
rotateCard('up', () => {
|
|
33778
33805
|
previosAntiFraudAnimateTime = Date.now();
|
|
33779
|
-
}
|
|
33806
|
+
});
|
|
33780
33807
|
break;
|
|
33781
33808
|
case idRecognition.EAuthMeIDCardAntiFraudStage.Down:
|
|
33782
33809
|
rotateCard('down', () => {
|
|
33783
33810
|
previosAntiFraudAnimateTime = Date.now();
|
|
33784
|
-
}
|
|
33811
|
+
});
|
|
33785
33812
|
break;
|
|
33786
33813
|
}
|
|
33787
33814
|
}
|
|
@@ -37247,8 +37274,8 @@ class AuthmeIdentityVerification extends engine.AuthmeFunctionModule {
|
|
|
37247
37274
|
}
|
|
37248
37275
|
|
|
37249
37276
|
var name = "authme/sdk";
|
|
37250
|
-
var version$1 = "2.8.
|
|
37251
|
-
var date = "2025-11-
|
|
37277
|
+
var version$1 = "2.8.33";
|
|
37278
|
+
var date = "2025-11-21T09:00:22+0000";
|
|
37252
37279
|
var packageInfo = {
|
|
37253
37280
|
name: name,
|
|
37254
37281
|
version: version$1,
|
package/index.js
CHANGED
|
@@ -30699,7 +30699,7 @@ function makeStyleTag(styleSetting) {
|
|
|
30699
30699
|
`;
|
|
30700
30700
|
return newStyle;
|
|
30701
30701
|
}
|
|
30702
|
-
function renderCardRotateAnimate(container) {
|
|
30702
|
+
function renderCardRotateAnimate(container, directionTextPanel = null, setAnimationFrameState) {
|
|
30703
30703
|
let animateStop = true;
|
|
30704
30704
|
let stopTimeout = null;
|
|
30705
30705
|
let currentDirection = null;
|
|
@@ -30719,6 +30719,10 @@ function renderCardRotateAnimate(container) {
|
|
|
30719
30719
|
frontArrowSvg.style.zIndex = `var(--authme-layers-2-z-index)`;
|
|
30720
30720
|
cardSvg.appendChild(cardMainGroup);
|
|
30721
30721
|
div.appendChild(cardSvg);
|
|
30722
|
+
// Append directionTextPanel to div.arrow if provided
|
|
30723
|
+
if (directionTextPanel) {
|
|
30724
|
+
div.appendChild(directionTextPanel);
|
|
30725
|
+
}
|
|
30722
30726
|
cardSvg.style.display = 'none';
|
|
30723
30727
|
frontArrowSvg.style.display = 'none';
|
|
30724
30728
|
backArrowSvg.style.display = 'none';
|
|
@@ -31055,9 +31059,8 @@ function renderCardRotateAnimate(container) {
|
|
|
31055
31059
|
}, roundAnimateDuration);
|
|
31056
31060
|
});
|
|
31057
31061
|
}
|
|
31058
|
-
function fadeAnimate(inOrOut
|
|
31062
|
+
function fadeAnimate(inOrOut) {
|
|
31059
31063
|
div.style.opacity = inOrOut === 'in' ? '0.8' : '0';
|
|
31060
|
-
if (directionTextPanel) directionTextPanel.style.display = inOrOut === 'in' ? 'flex' : 'none';
|
|
31061
31064
|
return new Promise(resolve => {
|
|
31062
31065
|
setTimeout(() => {
|
|
31063
31066
|
resolve(true);
|
|
@@ -31066,15 +31069,23 @@ function renderCardRotateAnimate(container) {
|
|
|
31066
31069
|
}
|
|
31067
31070
|
function rotateCard(direction, beforeAnimate = () => {
|
|
31068
31071
|
return;
|
|
31069
|
-
},
|
|
31072
|
+
}, stopOn = -1) {
|
|
31070
31073
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31071
31074
|
// console.log('rotateCard', direction);
|
|
31072
31075
|
animateStop = false;
|
|
31076
|
+
// 停止送圖(動畫開始)
|
|
31077
|
+
if (setAnimationFrameState) {
|
|
31078
|
+
setAnimationFrameState(true);
|
|
31079
|
+
}
|
|
31073
31080
|
stopTimeout = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
31074
31081
|
if (animateStop) return;
|
|
31075
|
-
yield fadeAnimate('out'
|
|
31082
|
+
yield fadeAnimate('out');
|
|
31076
31083
|
setTimeout(() => {
|
|
31077
31084
|
resetAnimateStatus();
|
|
31085
|
+
// 恢復送圖(動畫結束)
|
|
31086
|
+
if (setAnimationFrameState) {
|
|
31087
|
+
setAnimationFrameState(false);
|
|
31088
|
+
}
|
|
31078
31089
|
}, fadeDuration);
|
|
31079
31090
|
beforeAnimate();
|
|
31080
31091
|
}), stopOn === -1 ? roundAnimateDuration * 2 : stopOn);
|
|
@@ -31083,7 +31094,7 @@ function renderCardRotateAnimate(container) {
|
|
|
31083
31094
|
cardSvg.style.display = 'block';
|
|
31084
31095
|
frontArrowSvg.style.display = 'block';
|
|
31085
31096
|
backArrowSvg.style.display = 'block';
|
|
31086
|
-
yield fadeAnimate('in'
|
|
31097
|
+
yield fadeAnimate('in');
|
|
31087
31098
|
function _rotateCard(direction) {
|
|
31088
31099
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31089
31100
|
switch (direction) {
|
|
@@ -32609,7 +32620,7 @@ function startOCR(config) {
|
|
|
32609
32620
|
if (type !== EAuthMeCardClass.TWN_IDCard_Front || !config.ocrConfig.needAntiFraud) {
|
|
32610
32621
|
return of(true);
|
|
32611
32622
|
}
|
|
32612
|
-
const applyTextByResult = result => {
|
|
32623
|
+
const applyTextByResult = result => __awaiter(this, void 0, void 0, function* () {
|
|
32613
32624
|
if (!uiComponentOCRMask.setCardBorderColor) return;
|
|
32614
32625
|
uiComponentOCR.statusText.classList.add('non-empty');
|
|
32615
32626
|
switch (result.eStatus) {
|
|
@@ -32697,13 +32708,11 @@ function startOCR(config) {
|
|
|
32697
32708
|
break;
|
|
32698
32709
|
case EAuthMeIDCardAntiFraudStatus.StagePass:
|
|
32699
32710
|
uiComponentOCR.statusText.textContent = translateService.translate('sdk.general.verify.error.stagePass');
|
|
32700
|
-
stopAnimate();
|
|
32701
32711
|
previosAntiFraudAnimateTime = Date.now();
|
|
32702
32712
|
uiComponentOCRMask.setCardBorderColor('pass');
|
|
32703
|
-
//
|
|
32704
|
-
|
|
32705
|
-
|
|
32706
|
-
}, 2000);
|
|
32713
|
+
// Block execution for 2 seconds to show StagePass state
|
|
32714
|
+
yield new Promise(resolve => setTimeout(resolve, 2000));
|
|
32715
|
+
stopAnimate();
|
|
32707
32716
|
break;
|
|
32708
32717
|
case EAuthMeIDCardAntiFraudStatus.Pass:
|
|
32709
32718
|
uiComponentOCRMask.setCardBorderColor('pass');
|
|
@@ -32731,8 +32740,12 @@ function startOCR(config) {
|
|
|
32731
32740
|
uiComponentOCR.statusText.textContent = '';
|
|
32732
32741
|
uiComponentOCR.statusText.classList.remove('non-empty');
|
|
32733
32742
|
}
|
|
32734
|
-
};
|
|
32735
|
-
const antiFraudStart$ = of(true).pipe(switchMap(() => checkOnlineStatus(translateService.translate('sdk.general.error.alert.offline'), translateService.translate('sdk.general.error.retry'))), switchMap(() => canvasSizeInfo$), switchMap(canvasSizeInfo => from(config.setFrameSize(canvasSizeInfo.canvasWidth, canvasSizeInfo.canvasHeight)).pipe(switchMap(() =>
|
|
32743
|
+
});
|
|
32744
|
+
const antiFraudStart$ = of(true).pipe(switchMap(() => checkOnlineStatus(translateService.translate('sdk.general.error.alert.offline'), translateService.translate('sdk.general.error.retry'))), switchMap(() => canvasSizeInfo$), switchMap(canvasSizeInfo => from(config.setFrameSize(canvasSizeInfo.canvasWidth, canvasSizeInfo.canvasHeight)).pipe(switchMap(() => {
|
|
32745
|
+
// 動畫開始時停止送圖
|
|
32746
|
+
ocrSendFrameAnimation = true;
|
|
32747
|
+
return config.antiFraudStart(getCardBorderPoint(), uiComponentOCRMask.setBorderType, uiComponentOCRMask.setCardBorderColor, uiComponentOCRMask.setBorderSuccess, uiComponentOCR.scanAnimationContainer, uiComponentOCR.successContainer, uiComponentOCRMask.frameImage, uiComponentOCRMask.frameText, facingMode);
|
|
32748
|
+
}), tap(() => __awaiter(this, void 0, void 0, function* () {
|
|
32736
32749
|
setStatusView(StatusView.Aligning);
|
|
32737
32750
|
if (buttonDisable$) {
|
|
32738
32751
|
const cardMatchROI = config.getCardMatchROI ? yield config.getCardMatchROI() : undefined;
|
|
@@ -32742,8 +32755,18 @@ function startOCR(config) {
|
|
|
32742
32755
|
countDownTime = new Date().getTime() + ocrEngineConfig.expiredIn * TIME_UNIT.SECOND;
|
|
32743
32756
|
sdkFlowTimeout = makeSDKFlowTimeout(ocrEngineConfig.expiredIn);
|
|
32744
32757
|
}
|
|
32745
|
-
})),
|
|
32746
|
-
|
|
32758
|
+
})),
|
|
32759
|
+
// 反欺詐完成後恢復送圖
|
|
32760
|
+
tap(() => {
|
|
32761
|
+
ocrSendFrameAnimation = false;
|
|
32762
|
+
}), sendFrame(canvasSizeInfo, uiComponentOCR.image, uiComponentBasic.video, config.onAntiFraudFrame, ocrEngineConfig.fraudMaxFps, false, 'jpg', undefined,
|
|
32763
|
+
// 使用 sendFrame 內建的 flags 機制來控制動畫時的送圖
|
|
32764
|
+
{
|
|
32765
|
+
get animating() {
|
|
32766
|
+
return ocrSendFrameAnimation;
|
|
32767
|
+
}
|
|
32768
|
+
}), map(x => x.result), concatMap(x => __awaiter(this, void 0, void 0, function* () {
|
|
32769
|
+
yield applyTextByResult(x);
|
|
32747
32770
|
cardRotateByStage(x.eStage);
|
|
32748
32771
|
if (isTutorialFinish) {
|
|
32749
32772
|
cardRotateTextProcess(x.eStage, eStage != x.eStage);
|
|
@@ -32757,7 +32780,8 @@ function startOCR(config) {
|
|
|
32757
32780
|
// if (config.ocrConfig.disableTutorial) {
|
|
32758
32781
|
stopSpinner();
|
|
32759
32782
|
}
|
|
32760
|
-
|
|
32783
|
+
return x;
|
|
32784
|
+
})),
|
|
32761
32785
|
// ocrEngineConfig.expiredIn
|
|
32762
32786
|
// ? timeout(ocrEngineConfig.expiredIn * TIME_UNIT.SECOND)
|
|
32763
32787
|
// : tap(),
|
|
@@ -32980,7 +33004,6 @@ function startOCR(config) {
|
|
|
32980
33004
|
}));
|
|
32981
33005
|
};
|
|
32982
33006
|
uiComponentOCRMask.setCardBorderColor(null);
|
|
32983
|
-
let ocrSendFrameAnimation = false;
|
|
32984
33007
|
const handleOcrSendFrame = (canvasSizeInfo, canvas, video, frameCallback, fps, bas64Format, imageType, cardType, type) => source$ => {
|
|
32985
33008
|
let received = true;
|
|
32986
33009
|
const ctx = canvas.getContext('2d', {
|
|
@@ -33078,6 +33101,7 @@ function startOCR(config) {
|
|
|
33078
33101
|
};
|
|
33079
33102
|
return recognition(false);
|
|
33080
33103
|
}
|
|
33104
|
+
let ocrSendFrameAnimation = false;
|
|
33081
33105
|
function createFlowByType(type, cardType, cardTypeConfig) {
|
|
33082
33106
|
return of(true).pipe(tap(() => {
|
|
33083
33107
|
currentType('set', {
|
|
@@ -33205,7 +33229,10 @@ function startOCR(config) {
|
|
|
33205
33229
|
})),
|
|
33206
33230
|
container: uiComponentBasic.videoContainer
|
|
33207
33231
|
});
|
|
33208
|
-
const rotateUI = renderCardRotateAnimate(uiComponentOCR.arrowAnimationContainer
|
|
33232
|
+
const rotateUI = renderCardRotateAnimate(uiComponentOCR.arrowAnimationContainer, uiComponentOCR.directionTextPanel, isAnimating => {
|
|
33233
|
+
// 動畫開始時停止送圖,動畫結束時恢復送圖
|
|
33234
|
+
ocrSendFrameAnimation = isAnimating;
|
|
33235
|
+
});
|
|
33209
33236
|
rotateCard = rotateUI.rotateCard;
|
|
33210
33237
|
getIsRotateCardAnimating = rotateUI.getIsRotateCardAnimating;
|
|
33211
33238
|
stopAnimate = rotateUI.stopAnimate;
|
|
@@ -33758,22 +33785,22 @@ function startOCR(config) {
|
|
|
33758
33785
|
case EAuthMeIDCardAntiFraudStage.Left:
|
|
33759
33786
|
rotateCard(facingMode === 'front' ? 'right' : 'left', () => {
|
|
33760
33787
|
previosAntiFraudAnimateTime = Date.now();
|
|
33761
|
-
}
|
|
33788
|
+
});
|
|
33762
33789
|
break;
|
|
33763
33790
|
case EAuthMeIDCardAntiFraudStage.Right:
|
|
33764
33791
|
rotateCard(facingMode === 'front' ? 'left' : 'right', () => {
|
|
33765
33792
|
previosAntiFraudAnimateTime = Date.now();
|
|
33766
|
-
}
|
|
33793
|
+
});
|
|
33767
33794
|
break;
|
|
33768
33795
|
case EAuthMeIDCardAntiFraudStage.Up:
|
|
33769
33796
|
rotateCard('up', () => {
|
|
33770
33797
|
previosAntiFraudAnimateTime = Date.now();
|
|
33771
|
-
}
|
|
33798
|
+
});
|
|
33772
33799
|
break;
|
|
33773
33800
|
case EAuthMeIDCardAntiFraudStage.Down:
|
|
33774
33801
|
rotateCard('down', () => {
|
|
33775
33802
|
previosAntiFraudAnimateTime = Date.now();
|
|
33776
|
-
}
|
|
33803
|
+
});
|
|
33777
33804
|
break;
|
|
33778
33805
|
}
|
|
33779
33806
|
}
|
|
@@ -37239,8 +37266,8 @@ class AuthmeIdentityVerification extends AuthmeFunctionModule {
|
|
|
37239
37266
|
}
|
|
37240
37267
|
|
|
37241
37268
|
var name = "authme/sdk";
|
|
37242
|
-
var version$1 = "2.8.
|
|
37243
|
-
var date = "2025-11-
|
|
37269
|
+
var version$1 = "2.8.33";
|
|
37270
|
+
var date = "2025-11-21T09:00:22+0000";
|
|
37244
37271
|
var packageInfo = {
|
|
37245
37272
|
name: name,
|
|
37246
37273
|
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.33",
|
|
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.33",
|
|
9
|
+
"@authme/engine": "2.8.33",
|
|
10
|
+
"@authme/id-recognition": "2.8.33",
|
|
11
|
+
"@authme/liveness": "2.8.33",
|
|
12
|
+
"@authme/util": "2.8.33"
|
|
13
13
|
},
|
|
14
14
|
"module": "./index.js",
|
|
15
15
|
"main": "./index.cjs",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare type direction = 'left' | 'right' | 'up' | 'down';
|
|
2
|
-
export declare function renderCardRotateAnimate(container: HTMLElement): {
|
|
2
|
+
export declare function renderCardRotateAnimate(container: HTMLElement, directionTextPanel?: HTMLElement | null, setAnimationFrameState?: (isAnimating: boolean) => void): {
|
|
3
3
|
stopAnimate: () => Promise<unknown>;
|
|
4
|
-
rotateCard: (direction: direction, beforeAnimate?: () => void,
|
|
4
|
+
rotateCard: (direction: direction, beforeAnimate?: () => void, stopOn?: number) => Promise<void>;
|
|
5
5
|
getIsRotateCardAnimating: () => boolean;
|
|
6
6
|
};
|
|
7
7
|
export {};
|