@hanzo/event 0.3.21 → 0.3.22
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.cjs +44 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -51
- package/dist/index.d.ts +2 -51
- package/dist/index.mjs +4 -54
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +3 -6
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +1 -4
- package/dist/react.mjs.map +1 -1
- package/package.json +12 -9
- package/src/events.ts +21 -76
- package/LICENSE.md +0 -21
package/dist/react.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
|
+
var events = require('@hanzo/events');
|
|
4
5
|
|
|
5
6
|
// src/react.tsx
|
|
6
7
|
|
|
@@ -85,10 +86,6 @@ function dsnForProduct(product, key) {
|
|
|
85
86
|
return `https://${key}@api.hanzo.ai/v1/sentry/${projectId}`;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
// src/events.ts
|
|
89
|
-
var PAGEVIEW = "$pageview";
|
|
90
|
-
var EXCEPTION = "$exception";
|
|
91
|
-
|
|
92
89
|
// src/scrub.ts
|
|
93
90
|
var REDACTED = "[redacted]";
|
|
94
91
|
var EMAIL_MARK = "[email]";
|
|
@@ -835,7 +832,7 @@ var Analytics = class {
|
|
|
835
832
|
/** pageview records a $pageview for the current (or given) location. */
|
|
836
833
|
pageview(path, properties) {
|
|
837
834
|
const p = path ?? (isBrowser() ? window.location.pathname : void 0);
|
|
838
|
-
this.enqueue("pageview", PAGEVIEW, { path: p, properties });
|
|
835
|
+
this.enqueue("pageview", events.PAGEVIEW, { path: p, properties });
|
|
839
836
|
}
|
|
840
837
|
/** capture records a named product event with optional properties. Commerce
|
|
841
838
|
* fields (productId/quantity/revenue/currency) may be passed for order events. */
|
|
@@ -868,7 +865,7 @@ var Analytics = class {
|
|
|
868
865
|
const handled = context?.handled ?? true;
|
|
869
866
|
const ex = normalizeError2(err);
|
|
870
867
|
ex.handled = handled;
|
|
871
|
-
this.enqueue("event", EXCEPTION, {
|
|
868
|
+
this.enqueue("event", events.EXCEPTION, {
|
|
872
869
|
error: ex,
|
|
873
870
|
properties: {
|
|
874
871
|
...context?.properties,
|