@aranova/tracking-react 0.19.2 → 0.20.1

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
@@ -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({
@@ -2780,7 +2775,7 @@ function describeElement(el) {
2780
2775
  function resolveCtaName(el) {
2781
2776
  const explicit = el.getAttribute("data-aranova-cta");
2782
2777
  if (explicit && explicit.trim().length > 0) return explicit.trim();
2783
- const text = (el.textContent ?? "").trim().replace(/\s+/g, " ");
2778
+ const text = (el.textContent ?? "").trim().replaceAll(/\s+/g, " ");
2784
2779
  if (text.length > 0) return text.slice(0, CTA_NAME_MAX_LENGTH);
2785
2780
  return describeElement(el);
2786
2781
  }
@@ -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.2";
3558
+ var version = "0.20.1";
3564
3559
 
3565
3560
  // ../tracking-core/src/phone-react.tsx
3566
3561
  import {