Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/nextapp/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NextConfig } from "next";
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
/* config options here */
Expand Down
1 change: 1 addition & 0 deletions apps/nextapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dependencies": {
"@next/env": "^16.1.7",
"@tanstack/react-query": "^5.91.0",
"@azify/aziface-web": "1.3.0",
"axios": "1.13.6",
"next": "16.1.7",
"react": "19.2.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/viteapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@azify/aziface-web": "1.1.0",
"@azify/aziface-web": "1.3.0",
"@tailwindcss/vite": "^4.3.3",
"@tanstack/react-query": "5.91.0",
"axios": "1.13.6",
Expand Down
46 changes: 18 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 13 additions & 25 deletions packages/aziface/src/module/aziface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import { FaceTecSDK as FaceTecSDKType } from '../types/FaceTecSDK';
import { SessionError } from '../errors/errors';
import { SessionRequestProcessor } from '../services/request-processor';
import { applyTheme, getBackgroundColor } from '../styles/theme';
import {
getInitializationErrorCauseByCode,
applyResponsiveStyles,
} from '../utils';
import { getInitializationErrorCauseByCode } from '../utils';
import {
Controller,
DisposeCallback,
Expand Down Expand Up @@ -43,7 +40,6 @@ export class AzifaceController implements Controller {
public static baseUrl: string = '';
public static headers: InitializeHeaders = {} as InitializeHeaders;
private faceTecSDKInstance: FaceTecSDKInstance | null = null;
private internalID: number | undefined = undefined;

public static subscribe(listener: VoidFunction): VoidFunction {
AzifaceController.listeners.add(listener);
Expand Down Expand Up @@ -237,15 +233,22 @@ export class AzifaceController implements Controller {
error: undefined,
};

window.removeEventListener('click', applyResponsiveStyles);
window.clearInterval(this.internalID);

this.withTheme();
this.onStateChange();
};

private generateExternalDatabaseRefID = (): string =>
`aziface_web_${crypto.randomUUID()}`;
private generateExternalDatabaseRefID = (): string => {
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
/[xy]/g,
char => {
const random = (Math.random() * 16) | 0;
const value = char === 'x' ? random : (random & 0x3) | 0x8;
return value.toString(16);
},
);

return `aziface_web_${uuid}`;
};

private onInitializationSuccess = (
newFaceTecSdkInstance: FaceTecSDKInstance,
Expand All @@ -257,9 +260,6 @@ export class AzifaceController implements Controller {
private onInitializationError = (): void => this.cleanup();

private onComplete = (faceTecSessionStatus: FaceTecSessionStatus): void => {
window.removeEventListener('click', applyResponsiveStyles);
window.clearInterval(this.internalID);

const isError =
faceTecSessionStatus !== FaceTecSDK.FaceTecSessionStatus.SessionCompleted;

Expand Down Expand Up @@ -298,18 +298,6 @@ export class AzifaceController implements Controller {
} else {
throw new SessionError(MethodError.NotInitialized);
}

window.addEventListener('click', applyResponsiveStyles);

const windowClickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window,
});

this.internalID = window.setInterval(() => {
window.dispatchEvent(windowClickEvent);
}, 250);
};
}

Expand Down
20 changes: 1 addition & 19 deletions packages/aziface/src/styles/aziface.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,6 @@

#DOM_FT_mainInterfaceNonOverlayContainer {
@media (max-width: 768px) {
border: none !important;
}
}

#DOM_FT_readyScreenHeaderElement {
@media (max-width: 768px) {
font-size: 1rem !important;
}
}

#DOM_FT_readyScreenSubtextElement {
@media (max-width: 768px) {
font-size: 0.75rem !important;
}
}

#DOM_FT_yourAppLogoContainer {
@media (max-width: 768px) {
height: calc(100% - 360px) !important;
border: 2px solid white !important;
}
}
Loading
Loading