@aranova/tracking-next 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
@@ -1999,17 +1999,12 @@ var scrollDepthConfigSchema = z9.object({
1999
1999
 
2000
2000
  // ../tracking-core/src/events/specific-page-visit.ts
2001
2001
  import { z as z10 } from "zod";
2002
- var SPECIFIC_PAGE_NAMES = [
2003
- "contact_page",
2004
- "about_page",
2005
- "services_page",
2006
- "booking_page",
2007
- "location_page",
2008
- "pricing_page",
2009
- "faq_page",
2010
- "testimonials_page"
2011
- ];
2012
- var specificPageNameSchema = z10.enum(SPECIFIC_PAGE_NAMES);
2002
+ var PAGE_IDENTITY_MAX_LENGTH = 64;
2003
+ var PAGE_IDENTITY_PATTERN = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/;
2004
+ var pageIdentitySchema = z10.string().max(PAGE_IDENTITY_MAX_LENGTH).regex(PAGE_IDENTITY_PATTERN, {
2005
+ message: "page identity must be lowercase snake_case, start with a letter, and contain at most 64 characters"
2006
+ });
2007
+ var specificPageNameSchema = pageIdentitySchema;
2013
2008
  var specificPageVisitMetadataSchema = z10.object({
2014
2009
  page_name: specificPageNameSchema,
2015
2010
  page: z10.object({
@@ -2586,7 +2581,7 @@ function describeElement(el) {
2586
2581
  function resolveCtaName(el) {
2587
2582
  const explicit = el.getAttribute("data-aranova-cta");
2588
2583
  if (explicit && explicit.trim().length > 0) return explicit.trim();
2589
- const text = (el.textContent ?? "").trim().replace(/\s+/g, " ");
2584
+ const text = (el.textContent ?? "").trim().replaceAll(/\s+/g, " ");
2590
2585
  if (text.length > 0) return text.slice(0, CTA_NAME_MAX_LENGTH);
2591
2586
  return describeElement(el);
2592
2587
  }
@@ -3383,7 +3378,7 @@ function GoogleAdsTracking(props) {
3383
3378
  import { usePathname, useSearchParams } from "next/navigation";
3384
3379
 
3385
3380
  // package.json
3386
- var version = "0.19.2";
3381
+ var version = "0.20.1";
3387
3382
 
3388
3383
  // src/factory.tsx
3389
3384
  import {