@naniteninja/profile-comparison-lib 1.0.19 → 1.0.20

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.d.ts CHANGED
@@ -5,7 +5,6 @@ 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';
9
8
 
10
9
  /** Backend mode for the profile comparison component. */
11
10
  declare enum BackendMode {
@@ -36,13 +35,13 @@ declare const PROFILE_COMPARISON_VERBOSE_LOGGING: InjectionToken<() => boolean>;
36
35
  declare function resolveBackendUrl(backendUrl: string | null | undefined, backendMode: BackendMode, legacyTokenUrl: string | null | undefined): string | null;
37
36
 
38
37
  interface IProfileConfig {
38
+ person1Name?: string;
39
+ person2Name?: string;
39
40
  person1Interests: string[];
40
41
  person2Interests: string[];
41
42
  person3Interests: string[];
42
43
  user1Image: string;
43
44
  user2Image: string;
44
- edgeShading?: boolean;
45
- shadingColor?: string;
46
45
  }
47
46
 
48
47
  interface IBoundingBox {
@@ -206,10 +205,8 @@ interface IComparisonPayload {
206
205
  alignedPerson1Interests: string[];
207
206
  alignedPerson2Interests: string[];
208
207
  centerItem: string[];
209
- similarities: number[];
210
208
  matrixData: IMatrixData | null;
211
209
  rawLLMOutput?: string;
212
- debug?: any;
213
210
  }
214
211
 
215
212
  declare const STORE_NAMES: readonly ["openai-spacer", "openai-alignment", "openai-similarity", "openai-embeddings", "profile-face", "profile-compare"];
@@ -411,6 +408,7 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
411
408
  private imageCompressionService;
412
409
  private cdr;
413
410
  private getVerboseLogging?;
411
+ private static readonly DEFAULT_OBJECT_POSITION;
414
412
  private static readonly DEFAULT_EYE_ALIGNMENT_BIAS_PX;
415
413
  private static readonly DEFAULT_IMAGE_FORMAT;
416
414
  private static readonly DEFAULT_IMAGE_QUALITY_START;
@@ -424,15 +422,14 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
424
422
  private static readonly DEFAULT_MAX_HEIGHT;
425
423
  private static readonly SPACER_SMALL;
426
424
  private static readonly SPACER_LARGE;
427
- private static readonly PLACEHOLDER;
428
425
  private static readonly CONSOLIDATION_SEPARATOR_X;
429
426
  private static readonly CONSOLIDATION_SEPARATOR_SLASH;
430
427
  private static readonly FACEPP_RATE_LIMIT_DELAY_MS;
431
428
  private static readonly DEFAULT_PROFILE_IMAGE_NAME;
432
429
  private static readonly SHAPE_BG_HEIGHT;
433
430
  private static readonly SHAPE_BG_OBJECT_FIT;
434
- private static readonly SHAPE_BG1_BACK_POSITION;
435
- private static readonly SHAPE_BG2_BACK_POSITION;
431
+ private static readonly SHAPE_BG1_OBJECT_POSITION;
432
+ private static readonly SHAPE_BG2_OBJECT_POSITION;
436
433
  private static readonly DRAG_MIN_WIDTH;
437
434
  private static readonly DRAG_MAX_WIDTH;
438
435
  private static readonly MAX_DRAG_DISTANCE;
@@ -446,22 +443,26 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
446
443
  backendMode: BackendMode;
447
444
  backendUrl: string | null;
448
445
  fadeAllEdges: boolean;
446
+ person1Name: string;
447
+ person2Name: string;
449
448
  matrixDataChange: EventEmitter<IMatrixData>;
450
449
  rawLLMOutputChange: EventEmitter<string>;
451
450
  viewProfileClick: EventEmitter<{
452
451
  side: "left" | "right";
453
452
  }>;
454
- /** Fires when the user drags a frame to its maximum displacement and
455
- * continues pulling past the edge. The parent can use this to swipe to
456
- * the next/previous prospect in its own swiper. */
457
- edgeDrag: EventEmitter<"left" | "right">;
458
453
  selectedFile: File | null;
459
454
  firstImageData: FaceDetectionData | null;
460
455
  secondImageData: FaceDetectionData | null;
461
456
  user1Transform: string;
462
457
  user2Transform: string;
458
+ user1Top: string;
459
+ user1Height: string;
460
+ user2Top: string;
461
+ user2Height: string;
463
462
  alignmentCalculated: boolean;
464
463
  isAligning: boolean;
464
+ /** Set when backend returns an error (e.g. 503 API keys not configured). */
465
+ backendError: string | null;
465
466
  user1ObjectPosition: string;
466
467
  user2ObjectPosition: string;
467
468
  private user1NaturalWidth;
@@ -487,12 +488,6 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
487
488
  alignedPerson2Interests: string[];
488
489
  leftProfileClicked: boolean;
489
490
  rightProfileClicked: boolean;
490
- leftShapeAnimating: boolean;
491
- rightShapeAnimating: boolean;
492
- similarities: number[];
493
- get viewProfileLeftX(): number;
494
- get viewProfileRightX(): number;
495
- onResize(): void;
496
491
  sortedA: {
497
492
  item: string;
498
493
  score: number;
@@ -512,19 +507,21 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
512
507
  backendConfigured: boolean;
513
508
  /** The resolved backend URL computed from inputs and legacy token. */
514
509
  private resolvedBackendUrl;
515
- /** Flag to prevent click animations after a drag. */
516
- private wasDragging;
517
510
  compressionConfig: IImageCompressionConfig;
518
511
  private computeSub?;
519
512
  /** Incremented on each fetchComparison(); used to ignore stale success/error from an older request. */
520
513
  private fetchRequestId;
521
514
  leftContainer: ElementRef;
522
515
  rightContainer: ElementRef;
523
- leftFrame: ElementRef<HTMLElement>;
524
- rightFrame: ElementRef<HTMLElement>;
525
- leftBgFrame: ElementRef<HTMLElement>;
526
- rightBgFrame: ElementRef<HTMLElement>;
516
+ profileFlex: ElementRef<HTMLElement>;
517
+ profileImgLeft: ElementRef<HTMLElement>;
518
+ profileImgRight: ElementRef<HTMLElement>;
527
519
  shapeContainer: ElementRef<HTMLElement>;
520
+ shapeBg: ElementRef<HTMLElement>;
521
+ shapeBg1: ElementRef<SVGElement>;
522
+ shapeBg2: ElementRef<SVGElement>;
523
+ shapeTextLeft: ElementRef<HTMLElement>;
524
+ shapeTextRight: ElementRef<HTMLElement>;
528
525
  shapeTextCenter: ElementRef<HTMLElement>;
529
526
  constructor(backendService: ProfileComparisonBackendService, renderer: Renderer2, fileConversionService: FileConversionService, imageCompressionService: ImageCompressionService, cdr: ChangeDetectorRef, getVerboseLogging?: (() => boolean) | undefined);
530
527
  private log;
@@ -533,13 +530,8 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
533
530
  ngOnInit(): void;
534
531
  ngAfterViewInit(): void;
535
532
  ngOnChanges(changes: SimpleChanges): void;
536
- /**
537
- * Returns the type of dash based on similarity score:
538
- * - 'high': Very similar (Short single dash, 0.5 opacity)
539
- * - 'medium': Almost similar (Standard 1 dash)
540
- * - 'low': Very dissimilar (4 small dashes)
541
- */
542
- getDashType(index: number): 'high' | 'medium' | 'low';
533
+ /** Use for template: hide left/right item when it's a shared (center) item. Compares case-insensitively. */
534
+ isInCenter(interest: string): boolean;
543
535
  private fetchComparison;
544
536
  private updateConfigProperties;
545
537
  private buildConfigWithDefaults;
@@ -549,15 +541,13 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
549
541
  private getOverlapSizeCssPx;
550
542
  private setOverlapSizeCssPx;
551
543
  waitForImagesAndInitDrag(): void;
552
- /**
553
- * Toggles .edge-at-left-border / .edge-at-right-border classes on both
554
- * interactive and background frames based on their outer edge position
555
- * relative to the container boundary.
556
- */
557
- private updateEdgeMasks;
558
544
  initDrag(): void;
545
+ private getSimilarity;
546
+ private reorderInterestsByMatrix;
559
547
  onViewProfile(side: 'left' | 'right'): void;
560
- onShapeClick(side: 'left' | 'right'): void;
548
+ getPerson1UniqueInterests(): string[];
549
+ getPerson2UniqueInterests(): string[];
550
+ getChipOffset(index: number, column: 'left' | 'center' | 'right'): number;
561
551
  private compressConfigImagesIfNeeded;
562
552
  private compressImageStringToDataUrl;
563
553
  getEyeCoordinatesFromBBox(bbox: IBoundingBox): {
@@ -582,12 +572,12 @@ declare class ProfileComparisonLibComponent implements OnInit, AfterViewInit, On
582
572
  applyDefaultAlignment(): void;
583
573
  isValidFaceData(face: IBoundingBox): boolean;
584
574
  static ɵfac: i0.ɵɵFactoryDeclaration<ProfileComparisonLibComponent, [null, null, null, null, null, { optional: true; }]>;
585
- static ɵcmp: i0.ɵɵComponentDeclaration<ProfileComparisonLibComponent, "lib-profile-comparison", never, { "config": { "alias": "config"; "required": false; }; "backendMode": { "alias": "backendMode"; "required": false; }; "backendUrl": { "alias": "backendUrl"; "required": false; }; "fadeAllEdges": { "alias": "fadeAllEdges"; "required": false; }; }, { "matrixDataChange": "matrixDataChange"; "rawLLMOutputChange": "rawLLMOutputChange"; "viewProfileClick": "viewProfileClick"; "edgeDrag": "edgeDrag"; }, never, never, false, never>;
575
+ static ɵcmp: i0.ɵɵComponentDeclaration<ProfileComparisonLibComponent, "lib-profile-comparison", never, { "config": { "alias": "config"; "required": false; }; "backendMode": { "alias": "backendMode"; "required": false; }; "backendUrl": { "alias": "backendUrl"; "required": false; }; "fadeAllEdges": { "alias": "fadeAllEdges"; "required": false; }; "person1Name": { "alias": "person1Name"; "required": false; }; "person2Name": { "alias": "person2Name"; "required": false; }; }, { "matrixDataChange": "matrixDataChange"; "rawLLMOutputChange": "rawLLMOutputChange"; "viewProfileClick": "viewProfileClick"; }, never, never, false, never>;
586
576
  }
587
577
 
588
578
  declare class ProfileComparisonLibModule {
589
579
  static ɵfac: i0.ɵɵFactoryDeclaration<ProfileComparisonLibModule, never>;
590
- static ɵmod: i0.ɵɵNgModuleDeclaration<ProfileComparisonLibModule, [typeof ProfileComparisonLibComponent], [typeof i2.CommonModule, typeof i3.HttpClientModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.LibMarqueeModule], [typeof ProfileComparisonLibComponent]>;
580
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ProfileComparisonLibModule, [typeof ProfileComparisonLibComponent], [typeof i2.CommonModule, typeof i3.HttpClientModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule], [typeof ProfileComparisonLibComponent]>;
591
581
  static ɵinj: i0.ɵɵInjectorDeclaration<ProfileComparisonLibModule>;
592
582
  }
593
583
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naniteninja/profile-comparison-lib",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.0.0",
6
6
  "@angular/core": "^20.0.0"