@sonordev/site-kit 2.7.1 → 2.7.3

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 (47) hide show
  1. package/dist/AnalyticsProvider-GWZR3ID7.mjs +4 -0
  2. package/dist/{AnalyticsProvider-VAAWDXH3.mjs.map → AnalyticsProvider-GWZR3ID7.mjs.map} +1 -1
  3. package/dist/AnalyticsProvider-NBKOHK5M.js +25 -0
  4. package/dist/{AnalyticsProvider-MY64KGIH.js.map → AnalyticsProvider-NBKOHK5M.js.map} +1 -1
  5. package/dist/analytics/index.d.mts +12 -2
  6. package/dist/analytics/index.d.ts +12 -2
  7. package/dist/analytics/index.js +9 -9
  8. package/dist/analytics/index.mjs +2 -2
  9. package/dist/{chunk-2OGUBINV.js → chunk-4LC4KETS.js} +27 -7
  10. package/dist/chunk-4LC4KETS.js.map +1 -0
  11. package/dist/{chunk-QBNA75GS.js → chunk-7NC3UQEE.js} +19 -4
  12. package/dist/chunk-7NC3UQEE.js.map +1 -0
  13. package/dist/{chunk-W5QMQMUS.mjs → chunk-FO5EUANA.mjs} +3 -3
  14. package/dist/{chunk-W5QMQMUS.mjs.map → chunk-FO5EUANA.mjs.map} +1 -1
  15. package/dist/{chunk-6EEXEVSE.mjs → chunk-IM57FXP7.mjs} +17 -5
  16. package/dist/chunk-IM57FXP7.mjs.map +1 -0
  17. package/dist/{chunk-LWJDQ2BT.js → chunk-LPSWITNZ.js} +4 -4
  18. package/dist/{chunk-LWJDQ2BT.js.map → chunk-LPSWITNZ.js.map} +1 -1
  19. package/dist/{chunk-UOB7WK3K.mjs → chunk-PMVEDBWP.mjs} +19 -4
  20. package/dist/chunk-PMVEDBWP.mjs.map +1 -0
  21. package/dist/{chunk-MCIELZWP.mjs → chunk-RSUNHEBH.mjs} +25 -5
  22. package/dist/chunk-RSUNHEBH.mjs.map +1 -0
  23. package/dist/{chunk-EJXWFTKA.js → chunk-SYNJOJTP.js} +17 -5
  24. package/dist/chunk-SYNJOJTP.js.map +1 -0
  25. package/dist/commerce/index.js +48 -48
  26. package/dist/commerce/index.mjs +3 -3
  27. package/dist/index.js +28 -28
  28. package/dist/index.mjs +3 -3
  29. package/dist/layout/client.d.mts +1 -1
  30. package/dist/layout/client.d.ts +1 -1
  31. package/dist/layout/client.js +2 -2
  32. package/dist/layout/client.mjs +1 -1
  33. package/dist/layout/index.d.mts +1 -1
  34. package/dist/layout/index.d.ts +1 -1
  35. package/dist/layout/index.js +2 -2
  36. package/dist/layout/index.mjs +1 -1
  37. package/dist/{types-5RCOK10v.d.ts → types-YXQAZGpe.d.mts} +9 -0
  38. package/dist/{types-5RCOK10v.d.mts → types-YXQAZGpe.d.ts} +9 -0
  39. package/package.json +1 -1
  40. package/dist/AnalyticsProvider-MY64KGIH.js +0 -25
  41. package/dist/AnalyticsProvider-VAAWDXH3.mjs +0 -4
  42. package/dist/chunk-2OGUBINV.js.map +0 -1
  43. package/dist/chunk-6EEXEVSE.mjs.map +0 -1
  44. package/dist/chunk-EJXWFTKA.js.map +0 -1
  45. package/dist/chunk-MCIELZWP.mjs.map +0 -1
  46. package/dist/chunk-QBNA75GS.js.map +0 -1
  47. package/dist/chunk-UOB7WK3K.mjs.map +0 -1
@@ -0,0 +1,4 @@
1
+ export { AnalyticsProvider, useAnalytics, useAnalyticsOptional, useTrackEvent } from './chunk-IM57FXP7.mjs';
2
+ import './chunk-4XPGGLVP.mjs';
3
+ //# sourceMappingURL=AnalyticsProvider-GWZR3ID7.mjs.map
4
+ //# sourceMappingURL=AnalyticsProvider-GWZR3ID7.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-VAAWDXH3.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-GWZR3ID7.mjs"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ var chunkSYNJOJTP_js = require('./chunk-SYNJOJTP.js');
4
+ require('./chunk-ZSMWDLMK.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "AnalyticsProvider", {
9
+ enumerable: true,
10
+ get: function () { return chunkSYNJOJTP_js.AnalyticsProvider; }
11
+ });
12
+ Object.defineProperty(exports, "useAnalytics", {
13
+ enumerable: true,
14
+ get: function () { return chunkSYNJOJTP_js.useAnalytics; }
15
+ });
16
+ Object.defineProperty(exports, "useAnalyticsOptional", {
17
+ enumerable: true,
18
+ get: function () { return chunkSYNJOJTP_js.useAnalyticsOptional; }
19
+ });
20
+ Object.defineProperty(exports, "useTrackEvent", {
21
+ enumerable: true,
22
+ get: function () { return chunkSYNJOJTP_js.useTrackEvent; }
23
+ });
24
+ //# sourceMappingURL=AnalyticsProvider-NBKOHK5M.js.map
25
+ //# sourceMappingURL=AnalyticsProvider-NBKOHK5M.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-MY64KGIH.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-NBKOHK5M.js"}
@@ -29,9 +29,17 @@ interface AnalyticsProviderProps {
29
29
  externalSessionId?: string;
30
30
  /** Callback invoked with page metadata after each page view (used by Signal bridge) */
31
31
  onPageMetadata?: (metadata: Record<string, unknown>) => void;
32
+ /**
33
+ * Sub-site identifier (e.g. `ohiopowerstudies.com`). Every event tagged with
34
+ * this string so a single Sonor project can host many sites and the
35
+ * dashboard can filter / roll up per site. Normally passed in by
36
+ * SiteKitClientProviders; if omitted, falls back to
37
+ * `window.__SITE_KIT_SITE__` then `window.location.host`.
38
+ */
39
+ site?: string;
32
40
  }
33
41
  declare function AnalyticsProvider({ children, apiUrl: propApiUrl, apiKey: propApiKey, trackPageViews, trackWebVitals, trackScrollDepth, trackClicks, trackJourneys, // NEW: Enable journey tracking by default
34
- sessionTimeout, excludePaths, validateAgainstSitemap, debug, externalVisitorId, externalSessionId, onPageMetadata, }: AnalyticsProviderProps): react_jsx_runtime.JSX.Element;
42
+ sessionTimeout, excludePaths, validateAgainstSitemap, debug, externalVisitorId, externalSessionId, onPageMetadata, site: propSite, }: AnalyticsProviderProps): react_jsx_runtime.JSX.Element;
35
43
  declare function useAnalytics(): AnalyticsContextValue;
36
44
  /**
37
45
  * Safe version of useAnalytics that returns null when used outside of AnalyticsProvider.
@@ -51,9 +59,11 @@ declare function useTrackEvent(): {
51
59
  interface WebVitalsProps {
52
60
  apiUrl?: string;
53
61
  apiKey?: string;
62
+ /** Sub-site identifier (matches AnalyticsConfig.site). Tagged on every Web Vital event. */
63
+ site?: string;
54
64
  debug?: boolean;
55
65
  }
56
- declare function WebVitals({ apiUrl: propApiUrl, apiKey: propApiKey, debug }: WebVitalsProps): null;
66
+ declare function WebVitals({ apiUrl: propApiUrl, apiKey: propApiKey, site: propSite, debug }: WebVitalsProps): null;
57
67
 
58
68
  /**
59
69
  * @sonordev/site-kit/analytics - Contact Tracking Hook
@@ -29,9 +29,17 @@ interface AnalyticsProviderProps {
29
29
  externalSessionId?: string;
30
30
  /** Callback invoked with page metadata after each page view (used by Signal bridge) */
31
31
  onPageMetadata?: (metadata: Record<string, unknown>) => void;
32
+ /**
33
+ * Sub-site identifier (e.g. `ohiopowerstudies.com`). Every event tagged with
34
+ * this string so a single Sonor project can host many sites and the
35
+ * dashboard can filter / roll up per site. Normally passed in by
36
+ * SiteKitClientProviders; if omitted, falls back to
37
+ * `window.__SITE_KIT_SITE__` then `window.location.host`.
38
+ */
39
+ site?: string;
32
40
  }
33
41
  declare function AnalyticsProvider({ children, apiUrl: propApiUrl, apiKey: propApiKey, trackPageViews, trackWebVitals, trackScrollDepth, trackClicks, trackJourneys, // NEW: Enable journey tracking by default
34
- sessionTimeout, excludePaths, validateAgainstSitemap, debug, externalVisitorId, externalSessionId, onPageMetadata, }: AnalyticsProviderProps): react_jsx_runtime.JSX.Element;
42
+ sessionTimeout, excludePaths, validateAgainstSitemap, debug, externalVisitorId, externalSessionId, onPageMetadata, site: propSite, }: AnalyticsProviderProps): react_jsx_runtime.JSX.Element;
35
43
  declare function useAnalytics(): AnalyticsContextValue;
36
44
  /**
37
45
  * Safe version of useAnalytics that returns null when used outside of AnalyticsProvider.
@@ -51,9 +59,11 @@ declare function useTrackEvent(): {
51
59
  interface WebVitalsProps {
52
60
  apiUrl?: string;
53
61
  apiKey?: string;
62
+ /** Sub-site identifier (matches AnalyticsConfig.site). Tagged on every Web Vital event. */
63
+ site?: string;
54
64
  debug?: boolean;
55
65
  }
56
- declare function WebVitals({ apiUrl: propApiUrl, apiKey: propApiKey, debug }: WebVitalsProps): null;
66
+ declare function WebVitals({ apiUrl: propApiUrl, apiKey: propApiKey, site: propSite, debug }: WebVitalsProps): null;
57
67
 
58
68
  /**
59
69
  * @sonordev/site-kit/analytics - Contact Tracking Hook
@@ -1,39 +1,39 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkLWJDQ2BT_js = require('../chunk-LWJDQ2BT.js');
5
- var chunkEJXWFTKA_js = require('../chunk-EJXWFTKA.js');
4
+ var chunkLPSWITNZ_js = require('../chunk-LPSWITNZ.js');
5
+ var chunkSYNJOJTP_js = require('../chunk-SYNJOJTP.js');
6
6
  require('../chunk-ZSMWDLMK.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "ContactTracking", {
11
11
  enumerable: true,
12
- get: function () { return chunkLWJDQ2BT_js.ContactTracking; }
12
+ get: function () { return chunkLPSWITNZ_js.ContactTracking; }
13
13
  });
14
14
  Object.defineProperty(exports, "useContactTracking", {
15
15
  enumerable: true,
16
- get: function () { return chunkLWJDQ2BT_js.useContactTracking; }
16
+ get: function () { return chunkLPSWITNZ_js.useContactTracking; }
17
17
  });
18
18
  Object.defineProperty(exports, "AnalyticsProvider", {
19
19
  enumerable: true,
20
- get: function () { return chunkEJXWFTKA_js.AnalyticsProvider; }
20
+ get: function () { return chunkSYNJOJTP_js.AnalyticsProvider; }
21
21
  });
22
22
  Object.defineProperty(exports, "WebVitals", {
23
23
  enumerable: true,
24
- get: function () { return chunkEJXWFTKA_js.WebVitals; }
24
+ get: function () { return chunkSYNJOJTP_js.WebVitals; }
25
25
  });
26
26
  Object.defineProperty(exports, "useAnalytics", {
27
27
  enumerable: true,
28
- get: function () { return chunkEJXWFTKA_js.useAnalytics; }
28
+ get: function () { return chunkSYNJOJTP_js.useAnalytics; }
29
29
  });
30
30
  Object.defineProperty(exports, "useAnalyticsOptional", {
31
31
  enumerable: true,
32
- get: function () { return chunkEJXWFTKA_js.useAnalyticsOptional; }
32
+ get: function () { return chunkSYNJOJTP_js.useAnalyticsOptional; }
33
33
  });
34
34
  Object.defineProperty(exports, "useTrackEvent", {
35
35
  enumerable: true,
36
- get: function () { return chunkEJXWFTKA_js.useTrackEvent; }
36
+ get: function () { return chunkSYNJOJTP_js.useTrackEvent; }
37
37
  });
38
38
  //# sourceMappingURL=index.js.map
39
39
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- export { ContactTracking, useContactTracking } from '../chunk-W5QMQMUS.mjs';
3
- export { AnalyticsProvider, WebVitals, useAnalytics, useAnalyticsOptional, useTrackEvent } from '../chunk-6EEXEVSE.mjs';
2
+ export { ContactTracking, useContactTracking } from '../chunk-FO5EUANA.mjs';
3
+ export { AnalyticsProvider, WebVitals, useAnalytics, useAnalyticsOptional, useTrackEvent } from '../chunk-IM57FXP7.mjs';
4
4
  import '../chunk-4XPGGLVP.mjs';
5
5
  //# sourceMappingURL=index.mjs.map
6
6
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkEJXWFTKA_js = require('./chunk-EJXWFTKA.js');
4
+ var chunkSYNJOJTP_js = require('./chunk-SYNJOJTP.js');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React5 = require('react');
7
7
 
@@ -3107,7 +3107,7 @@ function ProductDetail({
3107
3107
  const [checkoutError, setCheckoutError] = React5.useState(null);
3108
3108
  const [showStickyBar, setShowStickyBar] = React5.useState(false);
3109
3109
  const buyButtonRef = React5.useRef(null);
3110
- const analytics = chunkEJXWFTKA_js.useAnalyticsOptional();
3110
+ const analytics = chunkSYNJOJTP_js.useAnalyticsOptional();
3111
3111
  React5.useEffect(() => {
3112
3112
  if (propProduct) {
3113
3113
  setProduct(propProduct);
@@ -4478,7 +4478,7 @@ function CheckoutForm({
4478
4478
  const [discountResult, setDiscountResult] = React5.useState(null);
4479
4479
  const [applyingDiscount, setApplyingDiscount] = React5.useState(false);
4480
4480
  const isProduct = offering.type === "product";
4481
- const analytics = chunkEJXWFTKA_js.useAnalyticsOptional();
4481
+ const analytics = chunkSYNJOJTP_js.useAnalyticsOptional();
4482
4482
  React5.useEffect(() => {
4483
4483
  fetchProcessorConfig().then((config) => {
4484
4484
  if (config?.processor) setProcessor(config.processor);
@@ -5027,8 +5027,28 @@ function loadSquareSDK2(environment) {
5027
5027
  }
5028
5028
  function resolveCssVar(name, fallback) {
5029
5029
  if (typeof window === "undefined") return fallback;
5030
- const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
5031
- return value || fallback;
5030
+ const raw = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
5031
+ if (!raw) return fallback;
5032
+ return normalizeColorForSquare(raw) ?? fallback;
5033
+ }
5034
+ function normalizeColorForSquare(value) {
5035
+ const v = value.trim();
5036
+ if (!v) return null;
5037
+ if (/^#[0-9a-f]{6}$/i.test(v)) return v;
5038
+ const eightDigit = /^(#[0-9a-f]{6})[0-9a-f]{2}$/i.exec(v);
5039
+ if (eightDigit) return eightDigit[1];
5040
+ const threeDigit = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(v);
5041
+ if (threeDigit) {
5042
+ const [, r, g, b] = threeDigit;
5043
+ return `#${r}${r}${g}${g}${b}${b}`;
5044
+ }
5045
+ const rgb = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(v);
5046
+ if (rgb) {
5047
+ const [, r, g, b] = rgb;
5048
+ const toHex = (n) => Number(n).toString(16).padStart(2, "0");
5049
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
5050
+ }
5051
+ return null;
5032
5052
  }
5033
5053
  var SINGLE_TICKET_KEY = "__single__";
5034
5054
  function EventCheckout({
@@ -7789,5 +7809,5 @@ exports.registerForEvent = registerForEvent;
7789
7809
  exports.useEventModal = useEventModal;
7790
7810
  exports.validateAddress = validateAddress;
7791
7811
  exports.validateDiscountCode = validateDiscountCode;
7792
- //# sourceMappingURL=chunk-2OGUBINV.js.map
7793
- //# sourceMappingURL=chunk-2OGUBINV.js.map
7812
+ //# sourceMappingURL=chunk-4LC4KETS.js.map
7813
+ //# sourceMappingURL=chunk-4LC4KETS.js.map