@sonordev/site-kit 3.0.3 → 3.0.5

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 (62) hide show
  1. package/dist/AnalyticsProvider-MLT26JRP.mjs +6 -0
  2. package/dist/{AnalyticsProvider-UKF7ESSP.mjs.map → AnalyticsProvider-MLT26JRP.mjs.map} +1 -1
  3. package/dist/AnalyticsProvider-WTOGN7LV.js +27 -0
  4. package/dist/{AnalyticsProvider-N3RNQXTK.js.map → AnalyticsProvider-WTOGN7LV.js.map} +1 -1
  5. package/dist/analytics/index.d.mts +1 -0
  6. package/dist/analytics/index.d.ts +1 -0
  7. package/dist/analytics/index.js +18 -9
  8. package/dist/analytics/index.mjs +3 -2
  9. package/dist/chunk-3DPXOZAU.mjs +26 -0
  10. package/dist/chunk-3DPXOZAU.mjs.map +1 -0
  11. package/dist/{chunk-7DW4SXNG.js → chunk-3GCEFS73.js} +5 -5
  12. package/dist/{chunk-7DW4SXNG.js.map → chunk-3GCEFS73.js.map} +1 -1
  13. package/dist/{chunk-ZDLBI3XX.mjs → chunk-65SMJBHW.mjs} +7 -2
  14. package/dist/chunk-65SMJBHW.mjs.map +1 -0
  15. package/dist/{chunk-ZM2ALSBM.js → chunk-7TX5BKVA.js} +18 -7
  16. package/dist/chunk-7TX5BKVA.js.map +1 -0
  17. package/dist/{chunk-S34XAPW2.mjs → chunk-AN4ATCYQ.mjs} +8 -8
  18. package/dist/chunk-AN4ATCYQ.mjs.map +1 -0
  19. package/dist/{chunk-XIGNKCHQ.js → chunk-EBJ4S5DU.js} +8 -8
  20. package/dist/chunk-EBJ4S5DU.js.map +1 -0
  21. package/dist/chunk-HMFFAUCD.js +30 -0
  22. package/dist/chunk-HMFFAUCD.js.map +1 -0
  23. package/dist/{chunk-FLD5R2PT.js → chunk-IBDVZ6BF.js} +7 -2
  24. package/dist/{chunk-FLD5R2PT.js.map → chunk-IBDVZ6BF.js.map} +1 -1
  25. package/dist/{chunk-UZ63S7FE.mjs → chunk-KMZ527EM.mjs} +3 -3
  26. package/dist/{chunk-UZ63S7FE.mjs.map → chunk-KMZ527EM.mjs.map} +1 -1
  27. package/dist/{chunk-GBZHL2IT.js → chunk-NNZDHLXN.js} +3 -3
  28. package/dist/{chunk-GBZHL2IT.js.map → chunk-NNZDHLXN.js.map} +1 -1
  29. package/dist/{chunk-PAYGGILT.mjs → chunk-T4QBSRA4.mjs} +3 -3
  30. package/dist/{chunk-PAYGGILT.mjs.map → chunk-T4QBSRA4.mjs.map} +1 -1
  31. package/dist/{chunk-6FWQMKVO.mjs → chunk-WN5A3KSY.mjs} +18 -7
  32. package/dist/chunk-WN5A3KSY.mjs.map +1 -0
  33. package/dist/client/index.d.mts +2 -0
  34. package/dist/client/index.d.ts +2 -0
  35. package/dist/client/index.js +9 -0
  36. package/dist/client/index.mjs +1 -0
  37. package/dist/commerce/index.js +49 -48
  38. package/dist/commerce/index.mjs +4 -3
  39. package/dist/dispatch-Cto83LLT.d.mts +28 -0
  40. package/dist/dispatch-DRQGcM8K.d.ts +28 -0
  41. package/dist/index.js +29 -28
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +4 -3
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/layout/client.js +2 -2
  46. package/dist/layout/client.mjs +1 -1
  47. package/dist/layout/index.js +2 -2
  48. package/dist/layout/index.mjs +1 -1
  49. package/dist/llms/index.d.mts +4 -0
  50. package/dist/llms/index.d.ts +4 -0
  51. package/dist/llms/index.js +12 -12
  52. package/dist/llms/index.mjs +2 -2
  53. package/dist/sitemap/index.js +2 -2
  54. package/dist/sitemap/index.mjs +1 -1
  55. package/package.json +1 -1
  56. package/dist/AnalyticsProvider-N3RNQXTK.js +0 -26
  57. package/dist/AnalyticsProvider-UKF7ESSP.mjs +0 -5
  58. package/dist/chunk-6FWQMKVO.mjs.map +0 -1
  59. package/dist/chunk-S34XAPW2.mjs.map +0 -1
  60. package/dist/chunk-XIGNKCHQ.js.map +0 -1
  61. package/dist/chunk-ZDLBI3XX.mjs.map +0 -1
  62. package/dist/chunk-ZM2ALSBM.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ export { AnalyticsProvider, useAnalytics, useAnalyticsOptional, useTrackEvent } from './chunk-65SMJBHW.mjs';
2
+ import './chunk-3DPXOZAU.mjs';
3
+ import './chunk-EE6SFAZP.mjs';
4
+ import './chunk-4XPGGLVP.mjs';
5
+ //# sourceMappingURL=AnalyticsProvider-MLT26JRP.mjs.map
6
+ //# sourceMappingURL=AnalyticsProvider-MLT26JRP.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-UKF7ESSP.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-MLT26JRP.mjs"}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var chunkIBDVZ6BF_js = require('./chunk-IBDVZ6BF.js');
4
+ require('./chunk-HMFFAUCD.js');
5
+ require('./chunk-3BNFUMLL.js');
6
+ require('./chunk-ZSMWDLMK.js');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "AnalyticsProvider", {
11
+ enumerable: true,
12
+ get: function () { return chunkIBDVZ6BF_js.AnalyticsProvider; }
13
+ });
14
+ Object.defineProperty(exports, "useAnalytics", {
15
+ enumerable: true,
16
+ get: function () { return chunkIBDVZ6BF_js.useAnalytics; }
17
+ });
18
+ Object.defineProperty(exports, "useAnalyticsOptional", {
19
+ enumerable: true,
20
+ get: function () { return chunkIBDVZ6BF_js.useAnalyticsOptional; }
21
+ });
22
+ Object.defineProperty(exports, "useTrackEvent", {
23
+ enumerable: true,
24
+ get: function () { return chunkIBDVZ6BF_js.useTrackEvent; }
25
+ });
26
+ //# sourceMappingURL=AnalyticsProvider-WTOGN7LV.js.map
27
+ //# sourceMappingURL=AnalyticsProvider-WTOGN7LV.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-N3RNQXTK.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"AnalyticsProvider-WTOGN7LV.js"}
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default from 'react';
3
3
  import { A as AnalyticsContextValue, T as TrackEventOptions, a as TrackConversionOptions } from '../types-DNSYU7qI.mjs';
4
4
  export { c as AnalyticsConfig, b as AnalyticsEvent, C as Conversion, P as PageView, S as Session, W as WebVitalsData } from '../types-DNSYU7qI.mjs';
5
+ export { a as trackConversion, t as trackEvent } from '../dispatch-Cto83LLT.mjs';
5
6
 
6
7
  interface AnalyticsProviderProps {
7
8
  /**
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default from 'react';
3
3
  import { A as AnalyticsContextValue, T as TrackEventOptions, a as TrackConversionOptions } from '../types-DNSYU7qI.js';
4
4
  export { c as AnalyticsConfig, b as AnalyticsEvent, C as Conversion, P as PageView, S as Session, W as WebVitalsData } from '../types-DNSYU7qI.js';
5
+ export { a as trackConversion, t as trackEvent } from '../dispatch-DRQGcM8K.js';
5
6
 
6
7
  interface AnalyticsProviderProps {
7
8
  /**
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkXIGNKCHQ_js = require('../chunk-XIGNKCHQ.js');
5
- var chunkFLD5R2PT_js = require('../chunk-FLD5R2PT.js');
4
+ var chunkEBJ4S5DU_js = require('../chunk-EBJ4S5DU.js');
5
+ var chunkIBDVZ6BF_js = require('../chunk-IBDVZ6BF.js');
6
+ var chunkHMFFAUCD_js = require('../chunk-HMFFAUCD.js');
6
7
  require('../chunk-3BNFUMLL.js');
7
8
  require('../chunk-ZSMWDLMK.js');
8
9
 
@@ -10,31 +11,39 @@ require('../chunk-ZSMWDLMK.js');
10
11
 
11
12
  Object.defineProperty(exports, "ContactTracking", {
12
13
  enumerable: true,
13
- get: function () { return chunkXIGNKCHQ_js.ContactTracking; }
14
+ get: function () { return chunkEBJ4S5DU_js.ContactTracking; }
14
15
  });
15
16
  Object.defineProperty(exports, "useContactTracking", {
16
17
  enumerable: true,
17
- get: function () { return chunkXIGNKCHQ_js.useContactTracking; }
18
+ get: function () { return chunkEBJ4S5DU_js.useContactTracking; }
18
19
  });
19
20
  Object.defineProperty(exports, "AnalyticsProvider", {
20
21
  enumerable: true,
21
- get: function () { return chunkFLD5R2PT_js.AnalyticsProvider; }
22
+ get: function () { return chunkIBDVZ6BF_js.AnalyticsProvider; }
22
23
  });
23
24
  Object.defineProperty(exports, "WebVitals", {
24
25
  enumerable: true,
25
- get: function () { return chunkFLD5R2PT_js.WebVitals; }
26
+ get: function () { return chunkIBDVZ6BF_js.WebVitals; }
26
27
  });
27
28
  Object.defineProperty(exports, "useAnalytics", {
28
29
  enumerable: true,
29
- get: function () { return chunkFLD5R2PT_js.useAnalytics; }
30
+ get: function () { return chunkIBDVZ6BF_js.useAnalytics; }
30
31
  });
31
32
  Object.defineProperty(exports, "useAnalyticsOptional", {
32
33
  enumerable: true,
33
- get: function () { return chunkFLD5R2PT_js.useAnalyticsOptional; }
34
+ get: function () { return chunkIBDVZ6BF_js.useAnalyticsOptional; }
34
35
  });
35
36
  Object.defineProperty(exports, "useTrackEvent", {
36
37
  enumerable: true,
37
- get: function () { return chunkFLD5R2PT_js.useTrackEvent; }
38
+ get: function () { return chunkIBDVZ6BF_js.useTrackEvent; }
39
+ });
40
+ Object.defineProperty(exports, "trackConversion", {
41
+ enumerable: true,
42
+ get: function () { return chunkHMFFAUCD_js.trackConversion; }
43
+ });
44
+ Object.defineProperty(exports, "trackEvent", {
45
+ enumerable: true,
46
+ get: function () { return chunkHMFFAUCD_js.trackEvent; }
38
47
  });
39
48
  //# sourceMappingURL=index.js.map
40
49
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,7 @@
1
1
  'use client';
2
- export { ContactTracking, useContactTracking } from '../chunk-S34XAPW2.mjs';
3
- export { AnalyticsProvider, WebVitals, useAnalytics, useAnalyticsOptional, useTrackEvent } from '../chunk-ZDLBI3XX.mjs';
2
+ export { ContactTracking, useContactTracking } from '../chunk-AN4ATCYQ.mjs';
3
+ export { AnalyticsProvider, WebVitals, useAnalytics, useAnalyticsOptional, useTrackEvent } from '../chunk-65SMJBHW.mjs';
4
+ export { trackConversion, trackEvent } from '../chunk-3DPXOZAU.mjs';
4
5
  import '../chunk-EE6SFAZP.mjs';
5
6
  import '../chunk-4XPGGLVP.mjs';
6
7
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,26 @@
1
+ // src/analytics/dispatch.ts
2
+ var MAX_QUEUE = 50;
3
+ var dispatcher = null;
4
+ var queue = [];
5
+ function registerAnalyticsDispatcher(next) {
6
+ dispatcher = next;
7
+ if (!next) return;
8
+ const pending = queue;
9
+ queue = [];
10
+ for (const call of pending) {
11
+ if (call.kind === "event") next.trackEvent(call.options);
12
+ else next.trackConversion(call.options);
13
+ }
14
+ }
15
+ function trackEvent(options) {
16
+ if (dispatcher) dispatcher.trackEvent(options);
17
+ else if (queue.length < MAX_QUEUE) queue.push({ kind: "event", options });
18
+ }
19
+ function trackConversion(options) {
20
+ if (dispatcher) dispatcher.trackConversion(options);
21
+ else if (queue.length < MAX_QUEUE) queue.push({ kind: "conversion", options });
22
+ }
23
+
24
+ export { registerAnalyticsDispatcher, trackConversion, trackEvent };
25
+ //# sourceMappingURL=chunk-3DPXOZAU.mjs.map
26
+ //# sourceMappingURL=chunk-3DPXOZAU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/analytics/dispatch.ts"],"names":[],"mappings":";AA4BA,IAAM,SAAA,GAAY,EAAA;AAElB,IAAI,UAAA,GAAyC,IAAA;AAC7C,IAAI,QAAsB,EAAC;AAMpB,SAAS,4BAA4B,IAAA,EAAwC;AAClF,EAAA,UAAA,GAAa,IAAA;AACb,EAAA,IAAI,CAAC,IAAA,EAAM;AACX,EAAA,MAAM,OAAA,GAAU,KAAA;AAChB,EAAA,KAAA,GAAQ,EAAC;AACT,EAAA,KAAA,MAAW,QAAQ,OAAA,EAAS;AAC1B,IAAA,IAAI,KAAK,IAAA,KAAS,OAAA,EAAS,IAAA,CAAK,UAAA,CAAW,KAAK,OAAO,CAAA;AAAA,SAClD,IAAA,CAAK,eAAA,CAAgB,IAAA,CAAK,OAAO,CAAA;AAAA,EACxC;AACF;AAOO,SAAS,WAAW,OAAA,EAAkC;AAC3D,EAAA,IAAI,UAAA,EAAY,UAAA,CAAW,UAAA,CAAW,OAAO,CAAA;AAAA,OAAA,IACpC,KAAA,CAAM,SAAS,SAAA,EAAW,KAAA,CAAM,KAAK,EAAE,IAAA,EAAM,OAAA,EAAS,OAAA,EAAS,CAAA;AAC1E;AAGO,SAAS,gBAAgB,OAAA,EAAuC;AACrE,EAAA,IAAI,UAAA,EAAY,UAAA,CAAW,eAAA,CAAgB,OAAO,CAAA;AAAA,OAAA,IACzC,KAAA,CAAM,SAAS,SAAA,EAAW,KAAA,CAAM,KAAK,EAAE,IAAA,EAAM,YAAA,EAAc,OAAA,EAAS,CAAA;AAC/E","file":"chunk-3DPXOZAU.mjs","sourcesContent":["/**\n * @sonordev/site-kit — standalone analytics dispatch bridge\n *\n * The analytics API is hook-based (useAnalytics), which requires living\n * inside <AnalyticsProvider>. But the house perf pattern mounts the provider\n * as a childless deferred SIBLING of the page tree (see DeferredAnalytics on\n * reference sites), so page components — and sibling packages like\n * @sonordev/agency-site-kit — can never reach the context.\n *\n * This module is the bridge: AnalyticsProvider registers its trackEvent /\n * trackConversion here on mount (single source of payload construction — do\n * NOT re-implement the POST anywhere else), and the standalone functions\n * below queue until it does. If the provider never mounts, calls no-op after\n * the queue cap — tracking must never break a page.\n */\n\nimport type { TrackEventOptions, TrackConversionOptions } from './types'\n\ninterface AnalyticsDispatcher {\n trackEvent: (options: TrackEventOptions) => void\n trackConversion: (options: TrackConversionOptions) => void\n}\n\ntype QueuedCall =\n | { kind: 'event'; options: TrackEventOptions }\n | { kind: 'conversion'; options: TrackConversionOptions }\n\n/** Pre-mount buffer — bounded so a page without analytics can't grow it forever. */\nconst MAX_QUEUE = 50\n\nlet dispatcher: AnalyticsDispatcher | null = null\nlet queue: QueuedCall[] = []\n\n/**\n * Called by AnalyticsProvider on mount/unmount. Flushes anything queued\n * before the (idle-deferred) provider arrived.\n */\nexport function registerAnalyticsDispatcher(next: AnalyticsDispatcher | null): void {\n dispatcher = next\n if (!next) return\n const pending = queue\n queue = []\n for (const call of pending) {\n if (call.kind === 'event') next.trackEvent(call.options)\n else next.trackConversion(call.options)\n }\n}\n\n/**\n * Track a custom analytics event from anywhere client-side — no provider\n * context needed. Queues until AnalyticsProvider mounts; no-ops (bounded)\n * if it never does.\n */\nexport function trackEvent(options: TrackEventOptions): void {\n if (dispatcher) dispatcher.trackEvent(options)\n else if (queue.length < MAX_QUEUE) queue.push({ kind: 'event', options })\n}\n\n/** Conversion twin of {@link trackEvent}. */\nexport function trackConversion(options: TrackConversionOptions): void {\n if (dispatcher) dispatcher.trackConversion(options)\n else if (queue.length < MAX_QUEUE) queue.push({ kind: 'conversion', options })\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkFLD5R2PT_js = require('./chunk-FLD5R2PT.js');
4
+ var chunkIBDVZ6BF_js = require('./chunk-IBDVZ6BF.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 = chunkFLD5R2PT_js.useAnalyticsOptional();
3110
+ const analytics = chunkIBDVZ6BF_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 = chunkFLD5R2PT_js.useAnalyticsOptional();
4481
+ const analytics = chunkIBDVZ6BF_js.useAnalyticsOptional();
4482
4482
  React5.useEffect(() => {
4483
4483
  fetchProcessorConfig().then((config) => {
4484
4484
  if (config?.processor) setProcessor(config.processor);
@@ -7809,5 +7809,5 @@ exports.registerForEvent = registerForEvent;
7809
7809
  exports.useEventModal = useEventModal;
7810
7810
  exports.validateAddress = validateAddress;
7811
7811
  exports.validateDiscountCode = validateDiscountCode;
7812
- //# sourceMappingURL=chunk-7DW4SXNG.js.map
7813
- //# sourceMappingURL=chunk-7DW4SXNG.js.map
7812
+ //# sourceMappingURL=chunk-3GCEFS73.js.map
7813
+ //# sourceMappingURL=chunk-3GCEFS73.js.map