@aranova/tracking-react 0.19.1 → 0.20.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.
package/dist/index.mjs CHANGED
@@ -1080,7 +1080,6 @@ function ensureScript(gtagId) {
1080
1080
  var TrackingConfigRuntime = class {
1081
1081
  constructor(ref, fetchImpl = globalThis.fetch) {
1082
1082
  this.ref = ref;
1083
- this.fetchImpl = fetchImpl;
1084
1083
  this.current = null;
1085
1084
  this.etag = null;
1086
1085
  this.stateValue = "unconfirmed";
@@ -1095,6 +1094,7 @@ var TrackingConfigRuntime = class {
1095
1094
  this.automaticQueue = [];
1096
1095
  this.pageQueue = [];
1097
1096
  this.listeners = /* @__PURE__ */ new Set();
1097
+ this.fetchImpl = fetchImpl.bind(globalThis);
1098
1098
  const cached = readCache2(ref.cdnUrl);
1099
1099
  this.current = cached?.config ?? null;
1100
1100
  this.etag = cached?.etag ?? null;
@@ -2058,17 +2058,12 @@ var scrollDepthConfigSchema = z9.object({
2058
2058
 
2059
2059
  // ../tracking-core/src/events/specific-page-visit.ts
2060
2060
  import { z as z10 } from "zod";
2061
- var SPECIFIC_PAGE_NAMES = [
2062
- "contact_page",
2063
- "about_page",
2064
- "services_page",
2065
- "booking_page",
2066
- "location_page",
2067
- "pricing_page",
2068
- "faq_page",
2069
- "testimonials_page"
2070
- ];
2071
- var specificPageNameSchema = z10.enum(SPECIFIC_PAGE_NAMES);
2061
+ var PAGE_IDENTITY_MAX_LENGTH = 64;
2062
+ var PAGE_IDENTITY_PATTERN = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/;
2063
+ var pageIdentitySchema = z10.string().max(PAGE_IDENTITY_MAX_LENGTH).regex(PAGE_IDENTITY_PATTERN, {
2064
+ message: "page identity must be lowercase snake_case, start with a letter, and contain at most 64 characters"
2065
+ });
2066
+ var specificPageNameSchema = pageIdentitySchema;
2072
2067
  var specificPageVisitMetadataSchema = z10.object({
2073
2068
  page_name: specificPageNameSchema,
2074
2069
  page: z10.object({
@@ -3560,7 +3555,7 @@ function GoogleAdsTracking(props) {
3560
3555
  import { createContext as createContext2, useContext as useContext2, useEffect as useEffect5, useMemo as useMemo4 } from "react";
3561
3556
 
3562
3557
  // package.json
3563
- var version = "0.19.1";
3558
+ var version = "0.20.0";
3564
3559
 
3565
3560
  // ../tracking-core/src/phone-react.tsx
3566
3561
  import {