@escape-game-over/atlas 0.1.75 → 0.1.76

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.
@@ -581,7 +581,9 @@ googleEvent("form_submissions_contact"); // does not compile
581
581
  A name nobody declared does not compile, so a typo cannot quietly become a
582
582
  second event in a report — which is why this is not a `string` with the standard
583
583
  names offered for autocomplete. Data declared with a required field is required
584
- at every call. The interfaces are `GoogleCustomEvents`, `MetaCustomEvents`,
584
+ at every call. A Google declaration may reuse a recommended name —
585
+ `generate_lead` with an agency's own parameters, say — and then takes what was
586
+ declared instead of GA4's. The interfaces are `GoogleCustomEvents`, `MetaCustomEvents`,
585
587
  `TikTokCustomEvents`, `UmamiEvents`, `DripEvents` and `ClarityEvents`; Clarity
586
588
  carries a name only, so its entries are all `undefined`. Snap and Axon take no
587
589
  declarations because they accept no names but their own.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escape-game-over/atlas",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
4
4
  "type": "module",
5
5
  "description": "Typed, data-driven machinery for static multi-locale, multi-deployment Astro sites.",
6
6
  "private": false,
@@ -78,22 +78,24 @@ export interface GoogleEventData {
78
78
  }
79
79
 
80
80
  /**
81
- * A recommended event takes GA4's parameters; `purchase` without its three
82
- * reports a sale of nothing, possibly twice. A declared one takes what the
83
- * project declared.
81
+ * A declared event takes what the project declared — checked first, so a
82
+ * project can declare a recommended name too, when its Tag Manager wants that
83
+ * name with its own parameters (an agency's `generate_lead`, say). Otherwise a
84
+ * recommended event takes GA4's parameters; `purchase` without its three
85
+ * reports a sale of nothing, possibly twice.
84
86
  */
85
87
  type GoogleEventArgs<E extends GoogleEventName> =
86
- E extends GoogleRecommendedEvent
87
- ? E extends "purchase"
88
- ? [
89
- data: GoogleEventData & {
90
- value: number;
91
- currency: CurrencyCode;
92
- transaction_id: string;
93
- },
94
- ]
95
- : [data?: GoogleEventData]
96
- : EventDataArgs<GoogleCustomEvents[E & keyof GoogleCustomEvents]>;
88
+ E extends DeclaredEvent<GoogleCustomEvents>
89
+ ? EventDataArgs<GoogleCustomEvents[E]>
90
+ : E extends "purchase"
91
+ ? [
92
+ data: GoogleEventData & {
93
+ value: number;
94
+ currency: CurrencyCode;
95
+ transaction_id: string;
96
+ },
97
+ ]
98
+ : [data?: GoogleEventData];
97
99
 
98
100
  /**
99
101
  * Records an event with Google — a lead sent, a booking made — through