@sonordev/site-kit 3.0.3 → 3.0.4
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/AnalyticsProvider-MLT26JRP.mjs +6 -0
- package/dist/{AnalyticsProvider-UKF7ESSP.mjs.map → AnalyticsProvider-MLT26JRP.mjs.map} +1 -1
- package/dist/AnalyticsProvider-WTOGN7LV.js +27 -0
- package/dist/{AnalyticsProvider-N3RNQXTK.js.map → AnalyticsProvider-WTOGN7LV.js.map} +1 -1
- package/dist/analytics/index.d.mts +1 -0
- package/dist/analytics/index.d.ts +1 -0
- package/dist/analytics/index.js +18 -9
- package/dist/analytics/index.mjs +3 -2
- package/dist/chunk-3DPXOZAU.mjs +26 -0
- package/dist/chunk-3DPXOZAU.mjs.map +1 -0
- package/dist/{chunk-7DW4SXNG.js → chunk-3GCEFS73.js} +5 -5
- package/dist/{chunk-7DW4SXNG.js.map → chunk-3GCEFS73.js.map} +1 -1
- package/dist/{chunk-ZDLBI3XX.mjs → chunk-65SMJBHW.mjs} +7 -2
- package/dist/chunk-65SMJBHW.mjs.map +1 -0
- package/dist/{chunk-S34XAPW2.mjs → chunk-AN4ATCYQ.mjs} +8 -8
- package/dist/chunk-AN4ATCYQ.mjs.map +1 -0
- package/dist/{chunk-XIGNKCHQ.js → chunk-EBJ4S5DU.js} +8 -8
- package/dist/chunk-EBJ4S5DU.js.map +1 -0
- package/dist/chunk-HMFFAUCD.js +30 -0
- package/dist/chunk-HMFFAUCD.js.map +1 -0
- package/dist/{chunk-FLD5R2PT.js → chunk-IBDVZ6BF.js} +7 -2
- package/dist/{chunk-FLD5R2PT.js.map → chunk-IBDVZ6BF.js.map} +1 -1
- package/dist/{chunk-UZ63S7FE.mjs → chunk-KMZ527EM.mjs} +3 -3
- package/dist/{chunk-UZ63S7FE.mjs.map → chunk-KMZ527EM.mjs.map} +1 -1
- package/dist/{chunk-GBZHL2IT.js → chunk-NNZDHLXN.js} +3 -3
- package/dist/{chunk-GBZHL2IT.js.map → chunk-NNZDHLXN.js.map} +1 -1
- package/dist/{chunk-PAYGGILT.mjs → chunk-T4QBSRA4.mjs} +3 -3
- package/dist/{chunk-PAYGGILT.mjs.map → chunk-T4QBSRA4.mjs.map} +1 -1
- package/dist/client/index.d.mts +2 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +9 -0
- package/dist/client/index.mjs +1 -0
- package/dist/commerce/index.js +49 -48
- package/dist/commerce/index.mjs +4 -3
- package/dist/dispatch-Cto83LLT.d.mts +28 -0
- package/dist/dispatch-DRQGcM8K.d.ts +28 -0
- package/dist/index.js +29 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/dist/layout/client.js +2 -2
- package/dist/layout/client.mjs +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/layout/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/AnalyticsProvider-N3RNQXTK.js +0 -26
- package/dist/AnalyticsProvider-UKF7ESSP.mjs +0 -5
- package/dist/chunk-S34XAPW2.mjs.map +0 -1
- package/dist/chunk-XIGNKCHQ.js.map +0 -1
- package/dist/chunk-ZDLBI3XX.mjs.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-
|
|
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-
|
|
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
|
/**
|
package/dist/analytics/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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
|
|
14
|
+
get: function () { return chunkEBJ4S5DU_js.ContactTracking; }
|
|
14
15
|
});
|
|
15
16
|
Object.defineProperty(exports, "useContactTracking", {
|
|
16
17
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkEBJ4S5DU_js.useContactTracking; }
|
|
18
19
|
});
|
|
19
20
|
Object.defineProperty(exports, "AnalyticsProvider", {
|
|
20
21
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkIBDVZ6BF_js.AnalyticsProvider; }
|
|
22
23
|
});
|
|
23
24
|
Object.defineProperty(exports, "WebVitals", {
|
|
24
25
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkIBDVZ6BF_js.WebVitals; }
|
|
26
27
|
});
|
|
27
28
|
Object.defineProperty(exports, "useAnalytics", {
|
|
28
29
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkIBDVZ6BF_js.useAnalytics; }
|
|
30
31
|
});
|
|
31
32
|
Object.defineProperty(exports, "useAnalyticsOptional", {
|
|
32
33
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkIBDVZ6BF_js.useAnalyticsOptional; }
|
|
34
35
|
});
|
|
35
36
|
Object.defineProperty(exports, "useTrackEvent", {
|
|
36
37
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
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
|
package/dist/analytics/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { ContactTracking, useContactTracking } from '../chunk-
|
|
3
|
-
export { AnalyticsProvider, WebVitals, useAnalytics, useAnalyticsOptional, useTrackEvent } from '../chunk-
|
|
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
|
|
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 =
|
|
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 =
|
|
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-
|
|
7813
|
-
//# sourceMappingURL=chunk-
|
|
7812
|
+
//# sourceMappingURL=chunk-3GCEFS73.js.map
|
|
7813
|
+
//# sourceMappingURL=chunk-3GCEFS73.js.map
|