@eric-emg/symphiq-components 1.2.388 → 1.2.389

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.
@@ -12,7 +12,7 @@ import * as i1$1 from '@angular/common';
12
12
  import { NgClass, CommonModule, isPlatformBrowser, DOCUMENT } from '@angular/common';
13
13
  import * as i2$1 from '@angular/forms';
14
14
  import { FormsModule, FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
15
- import { trigger, transition, style, animate, keyframes } from '@angular/animations';
15
+ import { trigger, transition, style, animate } from '@angular/animations';
16
16
  import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
17
17
  import { MarkdownComponent } from 'ngx-markdown';
18
18
  import dayjs from 'dayjs';
@@ -88124,6 +88124,70 @@ class ShopProfileViewToggleComponent {
88124
88124
  }], null, { viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }], currentView: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentView", required: false }] }], viewChanged: [{ type: i0.Output, args: ["viewChanged"] }] }); })();
88125
88125
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileViewToggleComponent, { className: "ShopProfileViewToggleComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-view-toggle.component.ts", lineNumber: 33 }); })();
88126
88126
 
88127
+ class ProfileAnswerAnimationService {
88128
+ constructor() {
88129
+ this.previousAnswerIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "previousAnswerIds" }] : []));
88130
+ this.animationState = signal({
88131
+ newAnswerIds: new Set(),
88132
+ removedAnswerIds: new Set()
88133
+ }, ...(ngDevMode ? [{ debugName: "animationState" }] : []));
88134
+ }
88135
+ getAnimationState() {
88136
+ return this.animationState.asReadonly();
88137
+ }
88138
+ snapshotCurrentAnswers(answerIds) {
88139
+ this.previousAnswerIds.set(new Set(answerIds));
88140
+ }
88141
+ computeAnimationState(currentAnswerIds) {
88142
+ const previous = this.previousAnswerIds();
88143
+ const current = new Set(currentAnswerIds);
88144
+ const newAnswerIds = new Set();
88145
+ const removedAnswerIds = new Set();
88146
+ current.forEach(id => {
88147
+ if (!previous.has(id)) {
88148
+ newAnswerIds.add(id);
88149
+ }
88150
+ });
88151
+ previous.forEach(id => {
88152
+ if (!current.has(id)) {
88153
+ removedAnswerIds.add(id);
88154
+ }
88155
+ });
88156
+ console.log('[AnimationService] State computed:', {
88157
+ previous: Array.from(previous),
88158
+ current: Array.from(current),
88159
+ newIds: Array.from(newAnswerIds),
88160
+ removedIds: Array.from(removedAnswerIds)
88161
+ });
88162
+ this.animationState.set({ newAnswerIds, removedAnswerIds });
88163
+ this.previousAnswerIds.set(current);
88164
+ }
88165
+ isNewAnswer(answerId) {
88166
+ return this.animationState().newAnswerIds.has(answerId);
88167
+ }
88168
+ clearAnimationState() {
88169
+ this.animationState.set({
88170
+ newAnswerIds: new Set(),
88171
+ removedAnswerIds: new Set()
88172
+ });
88173
+ }
88174
+ clearNewAnswer(answerId) {
88175
+ this.animationState.update(state => {
88176
+ const newIds = new Set(state.newAnswerIds);
88177
+ newIds.delete(answerId);
88178
+ return { ...state, newAnswerIds: newIds };
88179
+ });
88180
+ }
88181
+ static { this.ɵfac = function ProfileAnswerAnimationService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ProfileAnswerAnimationService)(); }; }
88182
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ProfileAnswerAnimationService, factory: ProfileAnswerAnimationService.ɵfac, providedIn: 'root' }); }
88183
+ }
88184
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ProfileAnswerAnimationService, [{
88185
+ type: Injectable,
88186
+ args: [{
88187
+ providedIn: 'root'
88188
+ }]
88189
+ }], null, null); })();
88190
+
88127
88191
  const _forTrack0$3 = ($index, $item) => $item.answer.id;
88128
88192
  function ShopProfileQuestionCardComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
88129
88193
  i0.ɵɵelementStart(0, "div", 4);
@@ -88173,7 +88237,10 @@ function ShopProfileQuestionCardComponent_Conditional_7_Template(rf, ctx) { if (
88173
88237
  i0.ɵɵrepeater(ctx_r0.relatedFocusAreas());
88174
88238
  } }
88175
88239
  function ShopProfileQuestionCardComponent_Conditional_8_For_2_Template(rf, ctx) { if (rf & 1) {
88176
- i0.ɵɵelementStart(0, "div", 18)(1, "span", 19);
88240
+ const _r3 = i0.ɵɵgetCurrentView();
88241
+ i0.ɵɵelementStart(0, "div", 18);
88242
+ i0.ɵɵlistener("animationend", function ShopProfileQuestionCardComponent_Conditional_8_For_2_Template_div_animationend_0_listener() { const answerData_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onAnimationEnd(answerData_r4.answer.id)); });
88243
+ i0.ɵɵelementStart(1, "span", 19);
88177
88244
  i0.ɵɵtext(2);
88178
88245
  i0.ɵɵelementEnd();
88179
88246
  i0.ɵɵelement(3, "symphiq-user-avatar", 20);
@@ -88182,19 +88249,20 @@ function ShopProfileQuestionCardComponent_Conditional_8_For_2_Template(rf, ctx)
88182
88249
  i0.ɵɵtext(5);
88183
88250
  i0.ɵɵelementEnd();
88184
88251
  } if (rf & 2) {
88185
- const answerData_r3 = ctx.$implicit;
88252
+ const answerData_r4 = ctx.$implicit;
88186
88253
  const ctx_r0 = i0.ɵɵnextContext(2);
88187
- i0.ɵɵproperty("@answerChip", undefined)("ngClass", ctx_r0.answerChipClasses());
88254
+ i0.ɵɵclassProp("animate-answer-pop-in", ctx_r0.isNewAnswer(answerData_r4.answer.id));
88255
+ i0.ɵɵproperty("ngClass", ctx_r0.answerChipClasses());
88188
88256
  i0.ɵɵadvance();
88189
88257
  i0.ɵɵproperty("ngClass", ctx_r0.answerTextClasses());
88190
88258
  i0.ɵɵadvance();
88191
- i0.ɵɵtextInterpolate1(" ", answerData_r3.answer.answer, " ");
88259
+ i0.ɵɵtextInterpolate1(" ", answerData_r4.answer.answer, " ");
88192
88260
  i0.ɵɵadvance();
88193
- i0.ɵɵproperty("viewMode", ctx_r0.viewMode())("user", answerData_r3.user);
88261
+ i0.ɵɵproperty("viewMode", ctx_r0.viewMode())("user", answerData_r4.user);
88194
88262
  i0.ɵɵadvance();
88195
- i0.ɵɵproperty("@answerChip", undefined)("ngClass", ctx_r0.answerDateClasses());
88263
+ i0.ɵɵproperty("ngClass", ctx_r0.answerDateClasses());
88196
88264
  i0.ɵɵadvance();
88197
- i0.ɵɵtextInterpolate1(" Answered ", ctx_r0.formatAnswerDate(answerData_r3.answer.createdDate), " ");
88265
+ i0.ɵɵtextInterpolate1(" Answered ", ctx_r0.formatAnswerDate(answerData_r4.answer.createdDate), " ");
88198
88266
  } }
88199
88267
  function ShopProfileQuestionCardComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
88200
88268
  i0.ɵɵelementStart(0, "div", 7);
@@ -88202,7 +88270,6 @@ function ShopProfileQuestionCardComponent_Conditional_8_Template(rf, ctx) { if (
88202
88270
  i0.ɵɵelementEnd();
88203
88271
  } if (rf & 2) {
88204
88272
  const ctx_r0 = i0.ɵɵnextContext();
88205
- i0.ɵɵproperty("@.disabled", !ctx_r0.animationsEnabled());
88206
88273
  i0.ɵɵadvance();
88207
88274
  i0.ɵɵrepeater(ctx_r0.questionAnswers());
88208
88275
  } }
@@ -88237,27 +88304,25 @@ function ShopProfileQuestionCardComponent_Conditional_9_Template(rf, ctx) { if (
88237
88304
  } }
88238
88305
  class ShopProfileQuestionCardComponent {
88239
88306
  constructor() {
88307
+ this.animationService = inject(ProfileAnswerAnimationService);
88240
88308
  this.question = input.required(...(ngDevMode ? [{ debugName: "question" }] : []));
88241
88309
  this.viewMode = input(ViewModeEnum.LIGHT, ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
88242
88310
  this.viewType = input('category', ...(ngDevMode ? [{ debugName: "viewType" }] : []));
88243
88311
  this.profileShopAnswers = input([], ...(ngDevMode ? [{ debugName: "profileShopAnswers" }] : []));
88244
88312
  this.users = input([], ...(ngDevMode ? [{ debugName: "users" }] : []));
88245
88313
  this.answerClick = output();
88246
- this.animationsEnabled = signal(false, ...(ngDevMode ? [{ debugName: "animationsEnabled" }] : []));
88247
88314
  this.questionAnswers = computed(() => {
88248
88315
  const questionId = this.question().id;
88249
88316
  const answers = this.profileShopAnswers();
88250
88317
  const allUsers = this.users();
88251
88318
  if (!questionId || !answers)
88252
88319
  return [];
88253
- const result = answers
88320
+ return answers
88254
88321
  .filter(a => a.profileQuestionId === questionId)
88255
88322
  .map(answer => ({
88256
88323
  answer,
88257
88324
  user: allUsers.find(u => u.id === answer.creatorUserId)
88258
88325
  }));
88259
- console.log(`[QuestionCard ${questionId}] Answers:`, result.map(r => r.answer.id));
88260
- return result;
88261
88326
  }, ...(ngDevMode ? [{ debugName: "questionAnswers" }] : []));
88262
88327
  this.isAnswered = computed(() => {
88263
88328
  return this.questionAnswers().length > 0;
@@ -88270,12 +88335,15 @@ class ShopProfileQuestionCardComponent {
88270
88335
  return q.focusAreaDomains || [];
88271
88336
  }, ...(ngDevMode ? [{ debugName: "relatedFocusAreas" }] : []));
88272
88337
  }
88273
- ngOnInit() {
88274
- console.log(`[QuestionCard ${this.question().id}] ngOnInit - enabling animations after delay`);
88275
- setTimeout(() => {
88276
- console.log(`[QuestionCard ${this.question().id}] Animations now enabled`);
88277
- this.animationsEnabled.set(true);
88278
- }, 100);
88338
+ isNewAnswer(answerId) {
88339
+ if (answerId === undefined)
88340
+ return false;
88341
+ return this.animationService.isNewAnswer(answerId);
88342
+ }
88343
+ onAnimationEnd(answerId) {
88344
+ if (answerId !== undefined) {
88345
+ this.animationService.clearNewAnswer(answerId);
88346
+ }
88279
88347
  }
88280
88348
  getFocusAreaTitle(focusArea) {
88281
88349
  return FocusAreaDomainEnumUtil.title(focusArea);
@@ -88379,7 +88447,7 @@ class ShopProfileQuestionCardComponent {
88379
88447
  : 'bg-gradient-to-r from-blue-500 to-cyan-500 hover:from-blue-600 hover:to-cyan-600 text-white shadow-lg shadow-blue-500/20';
88380
88448
  }
88381
88449
  static { this.ɵfac = function ShopProfileQuestionCardComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ShopProfileQuestionCardComponent)(); }; }
88382
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ShopProfileQuestionCardComponent, selectors: [["symphiq-shop-profile-question-card"]], inputs: { question: [1, "question"], viewMode: [1, "viewMode"], viewType: [1, "viewType"], profileShopAnswers: [1, "profileShopAnswers"], users: [1, "users"] }, outputs: { answerClick: "answerClick" }, decls: 16, vars: 9, consts: [[1, "rounded-xl", "border-2", "p-6", "transition-all", "duration-200", 3, "ngClass"], [1, "flex", "items-start", "gap-3"], [1, "flex-1", "min-w-0"], [1, "text-lg", "font-bold", "mb-2", 3, "ngClass"], [1, "flex-shrink-0", "w-6", "h-6", "rounded", "flex", "items-center", "justify-center", 3, "ngClass"], [1, "text-sm", "leading-relaxed", "mb-4", 3, "ngClass"], [1, "mb-4"], [1, "flex", "flex-wrap", "gap-3"], [1, "rounded-lg", "p-6", "border-2", "border-dashed", "text-center", 3, "ngClass"], [1, "mt-4", "flex", "justify-end"], ["type", "button", 1, "px-5", "py-2.5", "rounded-lg", "font-medium", "text-sm", "transition-all", "duration-300", "flex", "items-center", "gap-2", "hover:scale-105", "active:scale-95", 3, "click", "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-4", "h-4"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M9 5l7 7-7 7"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M5 13l4 4L19 7"], [1, "mb-2"], [1, "text-xs", "font-semibold", 3, "ngClass"], [1, "flex", "flex-wrap", "gap-2"], [1, "px-3", "py-1.5", "rounded-full", "text-xs", "font-medium", 3, "ngClass"], [1, "flex", "items-center", "gap-2", "px-4", "py-2.5", "rounded-full", 3, "ngClass"], [1, "text-sm", "font-medium", 3, "ngClass"], ["size", "small", 3, "viewMode", "user"], [1, "self-center", "text-xs", "-ml-1", 3, "ngClass"], [1, "flex", "flex-col", "items-center", "gap-3"], [1, "relative", "w-16", "h-16", 3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-full", "h-full", 3, "ngClass"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "1.5", "d", "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"], [1, "absolute", "top-1", "right-1", "w-3", "h-3", "rounded-full", "border-2", 3, "ngClass"], [1, "text-sm", "font-semibold", "mb-1", 3, "ngClass"], [1, "text-xs", 3, "ngClass"]], template: function ShopProfileQuestionCardComponent_Template(rf, ctx) { if (rf & 1) {
88450
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ShopProfileQuestionCardComponent, selectors: [["symphiq-shop-profile-question-card"]], inputs: { question: [1, "question"], viewMode: [1, "viewMode"], viewType: [1, "viewType"], profileShopAnswers: [1, "profileShopAnswers"], users: [1, "users"] }, outputs: { answerClick: "answerClick" }, decls: 16, vars: 9, consts: [[1, "rounded-xl", "border-2", "p-6", "transition-all", "duration-200", 3, "ngClass"], [1, "flex", "items-start", "gap-3"], [1, "flex-1", "min-w-0"], [1, "text-lg", "font-bold", "mb-2", 3, "ngClass"], [1, "flex-shrink-0", "w-6", "h-6", "rounded", "flex", "items-center", "justify-center", 3, "ngClass"], [1, "text-sm", "leading-relaxed", "mb-4", 3, "ngClass"], [1, "mb-4"], [1, "flex", "flex-wrap", "gap-3"], [1, "rounded-lg", "p-6", "border-2", "border-dashed", "text-center", 3, "ngClass"], [1, "mt-4", "flex", "justify-end"], ["type", "button", 1, "px-5", "py-2.5", "rounded-lg", "font-medium", "text-sm", "transition-all", "duration-300", "flex", "items-center", "gap-2", "hover:scale-105", "active:scale-95", 3, "click", "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-4", "h-4"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M9 5l7 7-7 7"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M5 13l4 4L19 7"], [1, "mb-2"], [1, "text-xs", "font-semibold", 3, "ngClass"], [1, "flex", "flex-wrap", "gap-2"], [1, "px-3", "py-1.5", "rounded-full", "text-xs", "font-medium", 3, "ngClass"], [1, "flex", "items-center", "gap-2", "px-4", "py-2.5", "rounded-full", 3, "animationend", "ngClass"], [1, "text-sm", "font-medium", 3, "ngClass"], ["size", "small", 3, "viewMode", "user"], [1, "self-center", "text-xs", "-ml-1", 3, "ngClass"], [1, "flex", "flex-col", "items-center", "gap-3"], [1, "relative", "w-16", "h-16", 3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-full", "h-full", 3, "ngClass"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "1.5", "d", "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"], [1, "absolute", "top-1", "right-1", "w-3", "h-3", "rounded-full", "border-2", 3, "ngClass"], [1, "text-sm", "font-semibold", "mb-1", 3, "ngClass"], [1, "text-xs", 3, "ngClass"]], template: function ShopProfileQuestionCardComponent_Template(rf, ctx) { if (rf & 1) {
88383
88451
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "h3", 3);
88384
88452
  i0.ɵɵtext(4);
88385
88453
  i0.ɵɵelementEnd()();
@@ -88387,7 +88455,7 @@ class ShopProfileQuestionCardComponent {
88387
88455
  i0.ɵɵelementEnd();
88388
88456
  i0.ɵɵconditionalCreate(6, ShopProfileQuestionCardComponent_Conditional_6_Template, 2, 2, "p", 5);
88389
88457
  i0.ɵɵconditionalCreate(7, ShopProfileQuestionCardComponent_Conditional_7_Template, 7, 2, "div", 6);
88390
- i0.ɵɵconditionalCreate(8, ShopProfileQuestionCardComponent_Conditional_8_Template, 3, 1, "div", 7)(9, ShopProfileQuestionCardComponent_Conditional_9_Template, 11, 6, "div", 8);
88458
+ i0.ɵɵconditionalCreate(8, ShopProfileQuestionCardComponent_Conditional_8_Template, 3, 0, "div", 7)(9, ShopProfileQuestionCardComponent_Conditional_9_Template, 11, 6, "div", 8);
88391
88459
  i0.ɵɵelementStart(10, "div", 9)(11, "button", 10);
88392
88460
  i0.ɵɵlistener("click", function ShopProfileQuestionCardComponent_Template_button_click_11_listener() { return ctx.onAnswerClick(); });
88393
88461
  i0.ɵɵelementStart(12, "span");
@@ -88415,43 +88483,11 @@ class ShopProfileQuestionCardComponent {
88415
88483
  i0.ɵɵproperty("ngClass", ctx.buttonClasses());
88416
88484
  i0.ɵɵadvance(2);
88417
88485
  i0.ɵɵtextInterpolate(ctx.isAnswered() ? "Edit Answer" : "Answer");
88418
- } }, dependencies: [CommonModule, i1$1.NgClass, UserAvatarComponent], encapsulation: 2, data: { animation: [
88419
- trigger('answerChip', [
88420
- transition(':enter', [
88421
- animate('500ms ease-out', keyframes([
88422
- style({ opacity: 0, transform: 'scale(0.8)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 0 }),
88423
- style({ opacity: 1, transform: 'scale(1.05)', boxShadow: '0 0 20px 4px rgba(59, 130, 246, 0.5)', offset: 0.5 }),
88424
- style({ opacity: 1, transform: 'scale(1)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 1 })
88425
- ]))
88426
- ]),
88427
- transition(':leave', [
88428
- animate('300ms ease-in', style({ opacity: 0, transform: 'scale(0.8)' }))
88429
- ])
88430
- ])
88431
- ] }, changeDetection: 0 }); }
88486
+ } }, dependencies: [CommonModule, i1$1.NgClass, UserAvatarComponent], styles: ["@keyframes _ngcontent-%COMP%_answerPopIn{0%{opacity:0;transform:scale(.8);box-shadow:0 0 #3b82f600}50%{opacity:1;transform:scale(1.05);box-shadow:0 0 20px 4px #3b82f680}to{opacity:1;transform:scale(1);box-shadow:0 0 #3b82f600}}.animate-answer-pop-in[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_answerPopIn .5s ease-out forwards}"], changeDetection: 0 }); }
88432
88487
  }
88433
88488
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ShopProfileQuestionCardComponent, [{
88434
88489
  type: Component,
88435
- args: [{
88436
- selector: 'symphiq-shop-profile-question-card',
88437
- standalone: true,
88438
- imports: [CommonModule, UserAvatarComponent],
88439
- changeDetection: ChangeDetectionStrategy.OnPush,
88440
- animations: [
88441
- trigger('answerChip', [
88442
- transition(':enter', [
88443
- animate('500ms ease-out', keyframes([
88444
- style({ opacity: 0, transform: 'scale(0.8)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 0 }),
88445
- style({ opacity: 1, transform: 'scale(1.05)', boxShadow: '0 0 20px 4px rgba(59, 130, 246, 0.5)', offset: 0.5 }),
88446
- style({ opacity: 1, transform: 'scale(1)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 1 })
88447
- ]))
88448
- ]),
88449
- transition(':leave', [
88450
- animate('300ms ease-in', style({ opacity: 0, transform: 'scale(0.8)' }))
88451
- ])
88452
- ])
88453
- ],
88454
- template: `
88490
+ args: [{ selector: 'symphiq-shop-profile-question-card', standalone: true, imports: [CommonModule, UserAvatarComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
88455
88491
  <div [ngClass]="containerClasses()" class="rounded-xl border-2 p-6 transition-all duration-200">
88456
88492
  <!-- Question Header with Checkbox -->
88457
88493
  <div class="flex items-start gap-3">
@@ -88497,9 +88533,13 @@ class ShopProfileQuestionCardComponent {
88497
88533
  <!-- Answer Section -->
88498
88534
  @if (questionAnswers().length > 0) {
88499
88535
  <!-- Answered State - Show answer chips -->
88500
- <div class="flex flex-wrap gap-3" [@.disabled]="!animationsEnabled()">
88536
+ <div class="flex flex-wrap gap-3">
88501
88537
  @for (answerData of questionAnswers(); track answerData.answer.id) {
88502
- <div @answerChip [ngClass]="answerChipClasses()" class="flex items-center gap-2 px-4 py-2.5 rounded-full">
88538
+ <div
88539
+ [ngClass]="answerChipClasses()"
88540
+ [class.animate-answer-pop-in]="isNewAnswer(answerData.answer.id)"
88541
+ (animationend)="onAnimationEnd(answerData.answer.id)"
88542
+ class="flex items-center gap-2 px-4 py-2.5 rounded-full">
88503
88543
  <span [ngClass]="answerTextClasses()" class="text-sm font-medium">
88504
88544
  {{ answerData.answer.answer }}
88505
88545
  </span>
@@ -88509,7 +88549,7 @@ class ShopProfileQuestionCardComponent {
88509
88549
  size="small"
88510
88550
  />
88511
88551
  </div>
88512
- <div @answerChip [ngClass]="answerDateClasses()" class="self-center text-xs -ml-1">
88552
+ <div [ngClass]="answerDateClasses()" class="self-center text-xs -ml-1">
88513
88553
  Answered {{ formatAnswerDate(answerData.answer.createdDate) }}
88514
88554
  </div>
88515
88555
  }
@@ -88551,10 +88591,9 @@ class ShopProfileQuestionCardComponent {
88551
88591
  </button>
88552
88592
  </div>
88553
88593
  </div>
88554
- `
88555
- }]
88594
+ `, styles: ["@keyframes answerPopIn{0%{opacity:0;transform:scale(.8);box-shadow:0 0 #3b82f600}50%{opacity:1;transform:scale(1.05);box-shadow:0 0 20px 4px #3b82f680}to{opacity:1;transform:scale(1);box-shadow:0 0 #3b82f600}}.animate-answer-pop-in{animation:answerPopIn .5s ease-out forwards}\n"] }]
88556
88595
  }], null, { question: [{ type: i0.Input, args: [{ isSignal: true, alias: "question", required: true }] }], viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }], viewType: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewType", required: false }] }], profileShopAnswers: [{ type: i0.Input, args: [{ isSignal: true, alias: "profileShopAnswers", required: false }] }], users: [{ type: i0.Input, args: [{ isSignal: true, alias: "users", required: false }] }], answerClick: [{ type: i0.Output, args: ["answerClick"] }] }); })();
88557
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionCardComponent, { className: "ShopProfileQuestionCardComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-question-card.component.ts", lineNumber: 136 }); })();
88596
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionCardComponent, { className: "ShopProfileQuestionCardComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-question-card.component.ts", lineNumber: 147 }); })();
88558
88597
 
88559
88598
  const _c0$5 = ["scrollContainer"];
88560
88599
  const _c1$2 = ["stickySentinel"];
@@ -89720,11 +89759,13 @@ class ShopProfileQuestionsModalComponent {
89720
89759
  this.renderer = inject(Renderer2);
89721
89760
  this.document = inject(DOCUMENT);
89722
89761
  this.hostElement = inject(ElementRef);
89762
+ this.animationService = inject(ProfileAnswerAnimationService);
89723
89763
  this.modalReady = signal(false, ...(ngDevMode ? [{ debugName: "modalReady" }] : []));
89724
89764
  this.answerModeActive = signal(false, ...(ngDevMode ? [{ debugName: "answerModeActive" }] : []));
89725
89765
  this.questionForAnswer = signal(null, ...(ngDevMode ? [{ debugName: "questionForAnswer" }] : []));
89726
89766
  this.navigationHistory = signal([], ...(ngDevMode ? [{ debugName: "navigationHistory" }] : []));
89727
89767
  this.modalMovedToBody = false;
89768
+ this.savePending = signal(false, ...(ngDevMode ? [{ debugName: "savePending" }] : []));
89728
89769
  this.viewType = computed(() => {
89729
89770
  if (this.showAllQuestions())
89730
89771
  return 'all';
@@ -89808,6 +89849,19 @@ class ShopProfileQuestionsModalComponent {
89808
89849
  this.questionForAnswer.set(null);
89809
89850
  this.navigationHistory.set([]);
89810
89851
  this.returnModalToHost();
89852
+ this.animationService.clearAnimationState();
89853
+ }
89854
+ });
89855
+ effect(() => {
89856
+ const answers = this.profileShopAnswers();
89857
+ const pending = this.savePending();
89858
+ if (pending && answers.length > 0) {
89859
+ const answerIds = answers
89860
+ .map(a => a.id)
89861
+ .filter((id) => id !== undefined);
89862
+ console.log('[Modal] Save completed, computing animation state');
89863
+ this.animationService.computeAnimationState(answerIds);
89864
+ this.savePending.set(false);
89811
89865
  }
89812
89866
  });
89813
89867
  }
@@ -89848,11 +89902,22 @@ class ShopProfileQuestionsModalComponent {
89848
89902
  }
89849
89903
  }
89850
89904
  onSaveAnswer(event) {
89905
+ this.snapshotAnswersForAnimation();
89851
89906
  this.answerSave.emit(event);
89852
89907
  }
89853
89908
  onSaveAndNextAnswer(event) {
89909
+ this.snapshotAnswersForAnimation();
89854
89910
  this.answerSave.emit(event);
89855
89911
  }
89912
+ snapshotAnswersForAnimation() {
89913
+ const answers = this.profileShopAnswers();
89914
+ const answerIds = answers
89915
+ .map(a => a.id)
89916
+ .filter((id) => id !== undefined);
89917
+ console.log('[Modal] Snapshotting current answers before save:', answerIds);
89918
+ this.animationService.snapshotCurrentAnswers(answerIds);
89919
+ this.savePending.set(true);
89920
+ }
89856
89921
  onNavigateToList() {
89857
89922
  this.answerModeActive.set(false);
89858
89923
  this.questionForAnswer.set(null);
@@ -90204,7 +90269,7 @@ class ShopProfileQuestionsModalComponent {
90204
90269
  type: ViewChild,
90205
90270
  args: ['modalWrapper']
90206
90271
  }] }); })();
90207
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionsModalComponent, { className: "ShopProfileQuestionsModalComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-questions-modal.component.ts", lineNumber: 201 }); })();
90272
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionsModalComponent, { className: "ShopProfileQuestionsModalComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-questions-modal.component.ts", lineNumber: 202 }); })();
90208
90273
 
90209
90274
  const _c0$3 = ["chartdiv"];
90210
90275
  function ShopProfileStatusCardComponent_Conditional_20_Template(rf, ctx) { if (rf & 1) {