@naniteninja/profile-comparison-lib 1.0.4 → 1.0.6
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/README.md +167 -167
- package/fesm2022/naniteninja-profile-comparison-lib.mjs +249 -196
- package/fesm2022/naniteninja-profile-comparison-lib.mjs.map +1 -1
- package/index.d.ts +34 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as i2 from '@angular/common';
|
|
|
5
5
|
import * as i3 from '@angular/common/http';
|
|
6
6
|
import { HttpClient } from '@angular/common/http';
|
|
7
7
|
import * as i4 from '@angular/forms';
|
|
8
|
+
import * as i5 from '@naniteninja/ionic-lib';
|
|
8
9
|
|
|
9
10
|
/** Backend mode for the profile comparison component. */
|
|
10
11
|
declare enum BackendMode {
|
|
@@ -40,6 +41,8 @@ interface IProfileConfig {
|
|
|
40
41
|
person3Interests: string[];
|
|
41
42
|
user1Image: string;
|
|
42
43
|
user2Image: string;
|
|
44
|
+
edgeShading?: boolean;
|
|
45
|
+
shadingColor?: string;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
interface IBoundingBox {
|
|
@@ -205,6 +208,7 @@ interface IComparisonPayload {
|
|
|
205
208
|
centerItem: string[];
|
|
206
209
|
matrixData: IMatrixData | null;
|
|
207
210
|
rawLLMOutput?: string;
|
|
211
|
+
debug?: any;
|
|
208
212
|
}
|
|
209
213
|
|
|
210
214
|
declare const STORE_NAMES: readonly ["openai-spacer", "openai-alignment", "openai-similarity", "openai-embeddings", "profile-face", "profile-compare"];
|
|
@@ -420,6 +424,7 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
|
|
|
420
424
|
private static readonly DEFAULT_MAX_HEIGHT;
|
|
421
425
|
private static readonly SPACER_SMALL;
|
|
422
426
|
private static readonly SPACER_LARGE;
|
|
427
|
+
private static readonly PLACEHOLDER;
|
|
423
428
|
private static readonly CONSOLIDATION_SEPARATOR_X;
|
|
424
429
|
private static readonly CONSOLIDATION_SEPARATOR_SLASH;
|
|
425
430
|
private static readonly FACEPP_RATE_LIMIT_DELAY_MS;
|
|
@@ -480,6 +485,8 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
|
|
|
480
485
|
alignedPerson2Interests: string[];
|
|
481
486
|
leftProfileClicked: boolean;
|
|
482
487
|
rightProfileClicked: boolean;
|
|
488
|
+
leftShapeAnimating: boolean;
|
|
489
|
+
rightShapeAnimating: boolean;
|
|
483
490
|
sortedA: {
|
|
484
491
|
item: string;
|
|
485
492
|
score: number;
|
|
@@ -505,15 +512,11 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
|
|
|
505
512
|
private fetchRequestId;
|
|
506
513
|
leftContainer: ElementRef;
|
|
507
514
|
rightContainer: ElementRef;
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
515
|
+
leftFrame: ElementRef<HTMLElement>;
|
|
516
|
+
rightFrame: ElementRef<HTMLElement>;
|
|
517
|
+
leftBgFrame: ElementRef<HTMLElement>;
|
|
518
|
+
rightBgFrame: ElementRef<HTMLElement>;
|
|
511
519
|
shapeContainer: ElementRef<HTMLElement>;
|
|
512
|
-
shapeBg: ElementRef<HTMLElement>;
|
|
513
|
-
shapeBg1: ElementRef<SVGElement>;
|
|
514
|
-
shapeBg2: ElementRef<SVGElement>;
|
|
515
|
-
shapeTextLeft: ElementRef<HTMLElement>;
|
|
516
|
-
shapeTextRight: ElementRef<HTMLElement>;
|
|
517
520
|
shapeTextCenter: ElementRef<HTMLElement>;
|
|
518
521
|
constructor(backendService: ProfileComparisonBackendService, renderer: Renderer2, fileConversionService: FileConversionService, imageCompressionService: ImageCompressionService, cdr: ChangeDetectorRef, getVerboseLogging?: (() => boolean) | undefined);
|
|
519
522
|
private log;
|
|
@@ -524,6 +527,27 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
|
|
|
524
527
|
ngOnChanges(changes: SimpleChanges): void;
|
|
525
528
|
/** Use for template: hide left/right item when it's a shared (center) item. Compares case-insensitively. */
|
|
526
529
|
isInCenter(interest: string): boolean;
|
|
530
|
+
/**
|
|
531
|
+
* Returns true if the value is a placeholder string consisting only of one or more dashes.
|
|
532
|
+
* Handles variations like "-", "---", "----", etc.
|
|
533
|
+
*/
|
|
534
|
+
/**
|
|
535
|
+
* Returns true if we should show a dash on the side instead of the text.
|
|
536
|
+
* This happens if:
|
|
537
|
+
* 1. The interest is a placeholder (----).
|
|
538
|
+
* 2. The interest exactly matches the center label at that index (to avoid redundancy).
|
|
539
|
+
*/
|
|
540
|
+
shouldShowDash(interest: string, index: number): boolean;
|
|
541
|
+
/**
|
|
542
|
+
* Returns true if the center label at the current index is a repeat of the one above it.
|
|
543
|
+
* This is used to "collapse" repeating categories into dashes.
|
|
544
|
+
*/
|
|
545
|
+
isCenterRedundant(index: number): boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Reorders the aligned results so that items with identical center labels follow each other.
|
|
548
|
+
*/
|
|
549
|
+
private regroupByCenterLabel;
|
|
550
|
+
isPlaceholder(val: unknown): boolean;
|
|
527
551
|
private fetchComparison;
|
|
528
552
|
private updateConfigProperties;
|
|
529
553
|
private buildConfigWithDefaults;
|
|
@@ -535,6 +559,7 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
|
|
|
535
559
|
waitForImagesAndInitDrag(): void;
|
|
536
560
|
initDrag(): void;
|
|
537
561
|
onViewProfile(side: 'left' | 'right'): void;
|
|
562
|
+
onShapeClick(side: 'left' | 'right'): void;
|
|
538
563
|
private compressConfigImagesIfNeeded;
|
|
539
564
|
private compressImageStringToDataUrl;
|
|
540
565
|
getEyeCoordinatesFromBBox(bbox: IBoundingBox): {
|
|
@@ -564,7 +589,7 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
|
|
|
564
589
|
|
|
565
590
|
declare class ProfileComparisonLibModule {
|
|
566
591
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProfileComparisonLibModule, never>;
|
|
567
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ProfileComparisonLibModule, [typeof ProfileComparisonLibComponent], [typeof i2.CommonModule, typeof i3.HttpClientModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule], [typeof ProfileComparisonLibComponent]>;
|
|
592
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ProfileComparisonLibModule, [typeof ProfileComparisonLibComponent], [typeof i2.CommonModule, typeof i3.HttpClientModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.LibMarqueeModule], [typeof ProfileComparisonLibComponent]>;
|
|
568
593
|
static ɵinj: i0.ɵɵInjectorDeclaration<ProfileComparisonLibModule>;
|
|
569
594
|
}
|
|
570
595
|
|