react-event-tracking 2.0.2 → 2.0.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.
package/dist/index.cjs CHANGED
@@ -81,7 +81,7 @@ const TrackRootComponent = ({
81
81
  const value = React.useMemo(() => {
82
82
  return new Proxy({}, {
83
83
  get(_, prop) {
84
- if (prop === track.name) return track;
84
+ if (prop === "track") return track;
85
85
  const handler = customHandlersRef.current?.[prop];
86
86
  if (typeof handler === "function") {
87
87
  return (...args) => handler(...args);
@@ -89,11 +89,11 @@ const TrackRootComponent = ({
89
89
  return void 0;
90
90
  },
91
91
  has(_, prop) {
92
- return prop === track.name || (customHandlersRef.current ? prop in customHandlersRef.current : false);
92
+ return prop === "track" || (customHandlersRef.current ? prop in customHandlersRef.current : false);
93
93
  },
94
94
  ownKeys() {
95
95
  const customKeys = customHandlersRef.current ? Object.keys(customHandlersRef.current) : [];
96
- return Array.from(/* @__PURE__ */ new Set([track.name, ...customKeys]));
96
+ return Array.from(/* @__PURE__ */ new Set(["track", ...customKeys]));
97
97
  },
98
98
  getOwnPropertyDescriptor(_, prop) {
99
99
  return {
@@ -106,16 +106,7 @@ const TrackRootComponent = ({
106
106
  return /* @__PURE__ */ React__default.createElement(TrackContext.Provider, { value }, children);
107
107
  };
108
108
  const factory = (args) => {
109
- return (props) => /* @__PURE__ */ React__default.createElement(
110
- TrackRootComponent,
111
- {
112
- onEvent: args.onEvent,
113
- filter: args.filter,
114
- transform: args.transform,
115
- customHandlers: args.customHandlers,
116
- ...props
117
- }
118
- );
109
+ return (props) => /* @__PURE__ */ React__default.createElement(TrackRootComponent, { ...args, ...props });
119
110
  };
120
111
  const TrackRoot = Object.assign(TrackRootComponent, { factory });
121
112
  const TrackProvider = ({
package/dist/index.mjs CHANGED
@@ -75,7 +75,7 @@ const TrackRootComponent = ({
75
75
  const value = useMemo(() => {
76
76
  return new Proxy({}, {
77
77
  get(_, prop) {
78
- if (prop === track.name) return track;
78
+ if (prop === "track") return track;
79
79
  const handler = customHandlersRef.current?.[prop];
80
80
  if (typeof handler === "function") {
81
81
  return (...args) => handler(...args);
@@ -83,11 +83,11 @@ const TrackRootComponent = ({
83
83
  return void 0;
84
84
  },
85
85
  has(_, prop) {
86
- return prop === track.name || (customHandlersRef.current ? prop in customHandlersRef.current : false);
86
+ return prop === "track" || (customHandlersRef.current ? prop in customHandlersRef.current : false);
87
87
  },
88
88
  ownKeys() {
89
89
  const customKeys = customHandlersRef.current ? Object.keys(customHandlersRef.current) : [];
90
- return Array.from(/* @__PURE__ */ new Set([track.name, ...customKeys]));
90
+ return Array.from(/* @__PURE__ */ new Set(["track", ...customKeys]));
91
91
  },
92
92
  getOwnPropertyDescriptor(_, prop) {
93
93
  return {
@@ -100,16 +100,7 @@ const TrackRootComponent = ({
100
100
  return /* @__PURE__ */ React.createElement(TrackContext.Provider, { value }, children);
101
101
  };
102
102
  const factory = (args) => {
103
- return (props) => /* @__PURE__ */ React.createElement(
104
- TrackRootComponent,
105
- {
106
- onEvent: args.onEvent,
107
- filter: args.filter,
108
- transform: args.transform,
109
- customHandlers: args.customHandlers,
110
- ...props
111
- }
112
- );
103
+ return (props) => /* @__PURE__ */ React.createElement(TrackRootComponent, { ...args, ...props });
113
104
  };
114
105
  const TrackRoot = Object.assign(TrackRootComponent, { factory });
115
106
  const TrackProvider = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-event-tracking",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "files": [
5
5
  "dist"
6
6
  ],