@nauticana/sail 0.5.5 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nauticana/sail",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Metadata-driven Angular component library for CRUD admin frontends backed by the keel Go backend. Tables, forms, navigation, OTP/2FA/social auth, billing.",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -92,17 +92,26 @@ export class ConsentGateComponent {
92
92
  }
93
93
  this.formValue.set(this.form.getRawValue());
94
94
  this.formValid.set(this.form.valid);
95
+ this.consentStateChange.emit(this.state());
95
96
  });
96
97
 
98
+ // Emit on every form change. We emit explicitly here rather than via a
99
+ // standalone `effect(() => emit(state()))` because output emission
100
+ // from inside an effect is unreliable in production AOT builds: the
101
+ // effect's scheduler runs in a microtask outside the user-event CD
102
+ // tick, and parent OnPush views can miss the propagated signal write.
103
+ // Emitting inside the RxJS subscription puts the emission on the
104
+ // synchronous click-handler path, where Angular's zone-aware CD
105
+ // picks up the parent's `consents` signal write deterministically.
97
106
  this.form.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
98
107
  this.formValue.set(this.form.getRawValue());
99
108
  this.formValid.set(this.form.valid);
109
+ this.consentStateChange.emit(this.state());
100
110
  });
101
111
  this.form.statusChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
102
112
  this.formValid.set(this.form.valid);
113
+ this.consentStateChange.emit(this.state());
103
114
  });
104
-
105
- effect(() => this.consentStateChange.emit(this.state()));
106
115
  }
107
116
 
108
117
  protected readonly ConsentType = ConsentType;