@aranova/tracking-react 1.13.0 → 1.14.0

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.
Files changed (34) hide show
  1. package/README.md +26 -0
  2. package/dist/{bookings-C1HMPjQl.d.ts → bookings-Bw2ImtPd.d.ts} +1 -1
  3. package/dist/{bookings-CHpplXU7.d.mts → bookings-CDGNZUaH.d.mts} +1 -1
  4. package/dist/client.d.mts +5 -4
  5. package/dist/client.d.ts +5 -4
  6. package/dist/client.js +365 -40
  7. package/dist/client.js.map +1 -1
  8. package/dist/client.mjs +363 -39
  9. package/dist/client.mjs.map +1 -1
  10. package/dist/{form-submit-CX-CxJjQ.d.mts → form-submit-C_vJXCxh.d.mts} +11 -1
  11. package/dist/{form-submit-CX-CxJjQ.d.ts → form-submit-C_vJXCxh.d.ts} +11 -1
  12. package/dist/index.d.mts +9 -180
  13. package/dist/index.d.ts +9 -180
  14. package/dist/index.js +28 -3
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +25 -3
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/{phone-utils-D12FW8tT.d.ts → phone-utils-Cfdx474X.d.mts} +178 -3
  19. package/dist/{phone-utils-BNiSqeF7.d.mts → phone-utils-D2TGPCQW.d.ts} +178 -3
  20. package/dist/phone.d.mts +2 -2
  21. package/dist/phone.d.ts +2 -2
  22. package/dist/phone.js +2 -2
  23. package/dist/phone.js.map +1 -1
  24. package/dist/phone.mjs +2 -2
  25. package/dist/phone.mjs.map +1 -1
  26. package/dist/{sales-YUH3bQl9.d.mts → sales-D4aU73mR.d.mts} +1 -1
  27. package/dist/{sales-CNvzyF5T.d.ts → sales-DkdrGIUS.d.ts} +1 -1
  28. package/dist/sales.d.mts +3 -3
  29. package/dist/sales.d.ts +3 -3
  30. package/dist/sales.js.map +1 -1
  31. package/dist/sales.mjs.map +1 -1
  32. package/dist/{ingest-typed-Ckt4R731.d.mts → submit-DuvP5AGN.d.ts} +161 -4
  33. package/dist/{ingest-typed-sCDoPInT.d.ts → submit-rqgXl-Wg.d.mts} +161 -4
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -195,6 +195,32 @@ page unload it records the **active** (visible) time spent on the page plus the
195
195
  depth reached, delivered via a keepalive beacon so the final page still counts. This powers
196
196
  per-page dwell and drop-off in the dashboard Analytics tab; there is nothing to configure.
197
197
 
198
+ ## Typed lead forms
199
+
200
+ Generate the site's lead-form contract once and send submits through it, so a dropped required
201
+ field fails `tsc` instead of losing leads:
202
+
203
+ ```bash
204
+ npx @aranova/tracking-cli forms gen # writes src/aranova-lead-forms.ts; `forms check` in CI
205
+ ```
206
+
207
+ ```tsx
208
+ import { createLeadFormSubmit, slotFields } from "@aranova/tracking-react";
209
+ import { ARANOVA_LEAD_FORMS } from "@/aranova-lead-forms";
210
+
211
+ const leadForms = createLeadFormSubmit(useTracking(), ARANOVA_LEAD_FORMS);
212
+ leadForms.submit({
213
+ formId: "booking-form",
214
+ kind: "booking",
215
+ fields: { given_name: values.firstName, phone: values.phone, ...slotFields(values.slot) },
216
+ });
217
+ ```
218
+
219
+ Development logs each contract violation, `debug` throws, production sends anyway tagged
220
+ `form.contract_violations`. A malformed hand-built `form_submit` is salvaged in production
221
+ (tagged `invalid_shape`) rather than dropped. Full guide:
222
+ [docs/tracking-package/lead-forms.md](../../docs/tracking-package/lead-forms.md).
223
+
198
224
  ## Phone Fields
199
225
 
200
226
  Bundled `libphonenumber-js`: parse/format utils + a React input. Display is configurable; the
@@ -1,4 +1,4 @@
1
- import { a as FormSubmitMetadata } from './form-submit-CX-CxJjQ.js';
1
+ import { b as FormSubmitMetadata } from './form-submit-C_vJXCxh.js';
2
2
 
3
3
  interface ServiceFiring {
4
4
  send_to: string;
@@ -1,4 +1,4 @@
1
- import { a as FormSubmitMetadata } from './form-submit-CX-CxJjQ.mjs';
1
+ import { b as FormSubmitMetadata } from './form-submit-C_vJXCxh.mjs';
2
2
 
3
3
  interface ServiceFiring {
4
4
  send_to: string;
package/dist/client.d.mts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent, AnchorHTMLAttributes } from 'react';
3
- import { G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, h as ConsentState, f as ConsentChoiceState, g as ConsentSource, T as TrackingParams, b as TrackingEnvironment, j as PhoneConfig, P as ParsedPhone, k as PhoneDisplayFormat } from './phone-utils-BNiSqeF7.mjs';
4
- import { T as TrackingConfigReference, C as ConversionConfig, i as BookingOutcome, g as BookingInput, a as BookingDetailsInput, c as BookingDetailsOutcome, S as SalesBookingsClient, f as BookingFormSubmit, j as BookingSimulation } from './bookings-CHpplXU7.mjs';
5
- import { X as TriggerRegistryConfig, Z as TypedTrackingClient, a as BookingHandoffPrefill, b as BookingIntegration, B as BookableDay } from './ingest-typed-Ckt4R731.mjs';
3
+ import { G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, h as ConsentState, f as ConsentChoiceState, g as ConsentSource, T as TrackingParams, b as TrackingEnvironment, s as PhoneConfig, P as ParsedPhone, t as PhoneDisplayFormat } from './phone-utils-Cfdx474X.mjs';
4
+ import { T as TrackingConfigReference, C as ConversionConfig, i as BookingOutcome, g as BookingInput, a as BookingDetailsInput, c as BookingDetailsOutcome, S as SalesBookingsClient, f as BookingFormSubmit, j as BookingSimulation } from './bookings-CDGNZUaH.mjs';
5
+ import { a7 as TriggerRegistryConfig, a9 as TypedTrackingClient, a as BookingHandoffPrefill, b as BookingIntegration, B as BookableDay } from './submit-rqgXl-Wg.mjs';
6
+ export { ai as createLeadFormSubmit } from './submit-rqgXl-Wg.mjs';
6
7
  import { CountryCode } from 'libphonenumber-js';
7
- import './form-submit-CX-CxJjQ.mjs';
8
+ import './form-submit-C_vJXCxh.mjs';
8
9
  import 'zod/mini';
9
10
  import 'zod/v4/core';
10
11
 
package/dist/client.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent, AnchorHTMLAttributes } from 'react';
3
- import { G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, h as ConsentState, f as ConsentChoiceState, g as ConsentSource, T as TrackingParams, b as TrackingEnvironment, j as PhoneConfig, P as ParsedPhone, k as PhoneDisplayFormat } from './phone-utils-D12FW8tT.js';
4
- import { T as TrackingConfigReference, C as ConversionConfig, i as BookingOutcome, g as BookingInput, a as BookingDetailsInput, c as BookingDetailsOutcome, S as SalesBookingsClient, f as BookingFormSubmit, j as BookingSimulation } from './bookings-C1HMPjQl.js';
5
- import { X as TriggerRegistryConfig, Z as TypedTrackingClient, a as BookingHandoffPrefill, b as BookingIntegration, B as BookableDay } from './ingest-typed-sCDoPInT.js';
3
+ import { G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, h as ConsentState, f as ConsentChoiceState, g as ConsentSource, T as TrackingParams, b as TrackingEnvironment, s as PhoneConfig, P as ParsedPhone, t as PhoneDisplayFormat } from './phone-utils-D2TGPCQW.js';
4
+ import { T as TrackingConfigReference, C as ConversionConfig, i as BookingOutcome, g as BookingInput, a as BookingDetailsInput, c as BookingDetailsOutcome, S as SalesBookingsClient, f as BookingFormSubmit, j as BookingSimulation } from './bookings-Bw2ImtPd.js';
5
+ import { a7 as TriggerRegistryConfig, a9 as TypedTrackingClient, a as BookingHandoffPrefill, b as BookingIntegration, B as BookableDay } from './submit-DuvP5AGN.js';
6
+ export { ai as createLeadFormSubmit } from './submit-DuvP5AGN.js';
6
7
  import { CountryCode } from 'libphonenumber-js';
7
- import './form-submit-CX-CxJjQ.js';
8
+ import './form-submit-C_vJXCxh.js';
8
9
  import 'zod/mini';
9
10
  import 'zod/v4/core';
10
11