@xylabs/react-pixel-debugger 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 (92) hide show
  1. package/dist/browser/PixelEvent.d.cts +5 -0
  2. package/dist/browser/PixelEvent.d.cts.map +1 -0
  3. package/dist/browser/components/PixelDebugger.d.cts +3 -0
  4. package/dist/browser/components/PixelDebugger.d.cts.map +1 -0
  5. package/dist/browser/components/PixelDebugger.js +8 -33
  6. package/dist/browser/components/PixelDebugger.js.map +1 -1
  7. package/dist/browser/components/PixelDebuggerProvider.d.cts +4 -0
  8. package/dist/browser/components/PixelDebuggerProvider.d.cts.map +1 -0
  9. package/dist/browser/components/PixelDebuggerProvider.js +2 -3
  10. package/dist/browser/components/PixelDebuggerProvider.js.map +1 -1
  11. package/dist/browser/components/PixelDebuggerToggle.d.cts +4 -0
  12. package/dist/browser/components/PixelDebuggerToggle.d.cts.map +1 -0
  13. package/dist/browser/components/PixelDebuggerToggle.js +2 -3
  14. package/dist/browser/components/PixelDebuggerToggle.js.map +1 -1
  15. package/dist/browser/components/index.d.cts +4 -0
  16. package/dist/browser/components/index.d.cts.map +1 -0
  17. package/dist/browser/components/index.js +3 -108
  18. package/dist/browser/components/index.js.map +1 -1
  19. package/dist/browser/hooks/index.d.cts +2 -0
  20. package/dist/browser/hooks/index.d.cts.map +1 -0
  21. package/dist/browser/hooks/index.js +1 -25
  22. package/dist/browser/hooks/index.js.map +1 -1
  23. package/dist/browser/hooks/usePixelAltSendHandler.d.cts +2 -0
  24. package/dist/browser/hooks/usePixelAltSendHandler.d.cts.map +1 -0
  25. package/dist/browser/hooks/usePixelAltSendHandler.js +1 -2
  26. package/dist/browser/hooks/usePixelAltSendHandler.js.map +1 -1
  27. package/dist/browser/index.d.cts +4 -0
  28. package/dist/browser/index.d.cts.map +1 -0
  29. package/dist/browser/index.js +3 -109
  30. package/dist/browser/index.js.map +1 -1
  31. package/dist/node/PixelEvent.cjs +19 -0
  32. package/dist/node/PixelEvent.cjs.map +1 -0
  33. package/dist/node/PixelEvent.d.cts +5 -0
  34. package/dist/node/PixelEvent.d.cts.map +1 -0
  35. package/dist/node/PixelEvent.js +0 -16
  36. package/dist/node/PixelEvent.js.map +1 -1
  37. package/dist/node/components/PixelDebugger.cjs +109 -0
  38. package/dist/node/components/PixelDebugger.cjs.map +1 -0
  39. package/dist/node/components/PixelDebugger.d.cts +3 -0
  40. package/dist/node/components/PixelDebugger.d.cts.map +1 -0
  41. package/dist/node/components/PixelDebugger.js +54 -53
  42. package/dist/node/components/PixelDebugger.js.map +1 -1
  43. package/dist/node/components/PixelDebuggerProvider.cjs +37 -0
  44. package/dist/node/components/{PixelDebuggerProvider.mjs.map → PixelDebuggerProvider.cjs.map} +1 -1
  45. package/dist/node/components/PixelDebuggerProvider.d.cts +4 -0
  46. package/dist/node/components/PixelDebuggerProvider.d.cts.map +1 -0
  47. package/dist/node/components/PixelDebuggerProvider.js +9 -32
  48. package/dist/node/components/PixelDebuggerProvider.js.map +1 -1
  49. package/dist/node/components/PixelDebuggerToggle.cjs +42 -0
  50. package/dist/node/components/{PixelDebuggerToggle.mjs.map → PixelDebuggerToggle.cjs.map} +1 -1
  51. package/dist/node/components/PixelDebuggerToggle.d.cts +4 -0
  52. package/dist/node/components/PixelDebuggerToggle.d.cts.map +1 -0
  53. package/dist/node/components/PixelDebuggerToggle.js +13 -36
  54. package/dist/node/components/PixelDebuggerToggle.js.map +1 -1
  55. package/dist/node/components/index.cjs +138 -0
  56. package/dist/node/components/index.cjs.map +1 -0
  57. package/dist/node/components/index.d.cts +4 -0
  58. package/dist/node/components/index.d.cts.map +1 -0
  59. package/dist/node/components/index.js +106 -24
  60. package/dist/node/components/index.js.map +1 -1
  61. package/dist/node/hooks/index.cjs +53 -0
  62. package/dist/node/hooks/index.cjs.map +1 -0
  63. package/dist/node/hooks/index.d.cts +2 -0
  64. package/dist/node/hooks/index.d.cts.map +1 -0
  65. package/dist/node/hooks/index.js +24 -21
  66. package/dist/node/hooks/index.js.map +1 -1
  67. package/dist/node/hooks/usePixelAltSendHandler.cjs +51 -0
  68. package/dist/node/hooks/{usePixelAltSendHandler.mjs.map → usePixelAltSendHandler.cjs.map} +1 -1
  69. package/dist/node/hooks/usePixelAltSendHandler.d.cts +2 -0
  70. package/dist/node/hooks/usePixelAltSendHandler.d.cts.map +1 -0
  71. package/dist/node/hooks/usePixelAltSendHandler.js +13 -36
  72. package/dist/node/hooks/usePixelAltSendHandler.js.map +1 -1
  73. package/dist/node/index.cjs +140 -0
  74. package/dist/node/index.cjs.map +1 -0
  75. package/dist/node/index.d.cts +4 -0
  76. package/dist/node/index.d.cts.map +1 -0
  77. package/dist/node/index.js +107 -24
  78. package/dist/node/index.js.map +1 -1
  79. package/package.json +15 -14
  80. package/dist/node/PixelEvent.mjs +0 -1
  81. package/dist/node/PixelEvent.mjs.map +0 -1
  82. package/dist/node/components/PixelDebugger.mjs +0 -59
  83. package/dist/node/components/PixelDebugger.mjs.map +0 -1
  84. package/dist/node/components/PixelDebuggerProvider.mjs +0 -11
  85. package/dist/node/components/PixelDebuggerToggle.mjs +0 -16
  86. package/dist/node/components/index.mjs +0 -4
  87. package/dist/node/components/index.mjs.map +0 -1
  88. package/dist/node/hooks/index.mjs +0 -2
  89. package/dist/node/hooks/index.mjs.map +0 -1
  90. package/dist/node/hooks/usePixelAltSendHandler.mjs +0 -25
  91. package/dist/node/index.mjs +0 -4
  92. package/dist/node/index.mjs.map +0 -1
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/index.ts
21
+ var components_exports = {};
22
+ __export(components_exports, {
23
+ PixelDebugger: () => PixelDebugger,
24
+ PixelDebuggerProvider: () => PixelDebuggerProvider,
25
+ PixelDebuggerToggle: () => PixelDebuggerToggle
26
+ });
27
+ module.exports = __toCommonJS(components_exports);
28
+
29
+ // src/components/PixelDebugger.tsx
30
+ var import_material = require("@mui/material");
31
+ var import_react_button = require("@xylabs/react-button");
32
+ var import_react_flexbox = require("@xylabs/react-flexbox");
33
+ var import_react_pixel = require("@xylabs/react-pixel");
34
+ var import_react_portal = require("@xylabs/react-portal");
35
+ var import_react2 = require("react");
36
+
37
+ // src/hooks/usePixelAltSendHandler.ts
38
+ var import_pixel = require("@xylabs/pixel");
39
+ var import_react = require("react");
40
+ var usePixelAltSendHandler = (altHandler) => {
41
+ const [pixelSend, setPixelSend] = (0, import_react.useState)();
42
+ (0, import_react.useEffect)(() => {
43
+ if (!pixelSend && import_pixel.XyPixel.instance.send) {
44
+ const oldHandler = import_pixel.XyPixel.instance.send.bind(import_pixel.XyPixel.instance);
45
+ setPixelSend(oldHandler);
46
+ } else {
47
+ import_pixel.XyPixel.instance.send = async (event, fields, eventId) => {
48
+ altHandler(event, fields);
49
+ return await (pixelSend == null ? void 0 : pixelSend(event, fields, eventId));
50
+ };
51
+ }
52
+ return () => {
53
+ if (pixelSend) {
54
+ import_pixel.XyPixel.instance.send = pixelSend;
55
+ }
56
+ };
57
+ }, [pixelSend, altHandler]);
58
+ };
59
+
60
+ // src/components/PixelDebugger.tsx
61
+ var import_jsx_runtime = require("react/jsx-runtime");
62
+ var PixelDebugger = () => {
63
+ const { isDebugging } = (0, import_react2.useContext)(import_react_pixel.DebugUserEventsContext);
64
+ const theme = (0, import_material.useTheme)();
65
+ const [displayEvents, setDisplayEvents] = (0, import_react2.useState)(false);
66
+ const [events, setEvents] = (0, import_react2.useState)([]);
67
+ usePixelAltSendHandler((event, fields) => {
68
+ setEvents((events2) => [{ event, fields }, ...events2]);
69
+ });
70
+ if (!isDebugging) {
71
+ return null;
72
+ }
73
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { bottom: 0, left: 0, position: "fixed", width: 350 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Badge, { badgeContent: events.length, color: "primary", sx: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
74
+ import_material.Card,
75
+ {
76
+ variant: "outlined",
77
+ sx: {
78
+ backdropFilter: "blur(16px) saturate(180%)",
79
+ backgroundColor: "rgba(18, 18, 18, .70)",
80
+ overflowY: "auto",
81
+ width: "100%"
82
+ },
83
+ color: theme.palette.primary.main,
84
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexCol, { alignItems: "stretch", sx: { flexFlow: "column", maxHeight: 400 }, children: [
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { alignItems: "stretch", sx: { flex: "0 1 auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_button.ButtonEx, { variant: "text", onClick: () => setDisplayEvents(!displayEvents), children: "XY Pixel Debugger" }) }),
86
+ displayEvents && !!events.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
+ import_react_flexbox.FlexCol,
88
+ {
89
+ alignItems: "stretch",
90
+ alignContent: "start",
91
+ padding: 2,
92
+ sx: { cursor: "pointer", flex: "1 1 auto", overflowY: "auto", userSelect: "none" },
93
+ children: events.map((e, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PixelEventDetails, { events, index, ...e }, `${e.event}-${index}`))
94
+ }
95
+ ),
96
+ displayEvents && !events.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle2", children: "No Events" })
97
+ ] })
98
+ }
99
+ ) }) }) });
100
+ };
101
+ var PixelEventDetails = ({ event, fields, index, events }) => {
102
+ const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
103
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexCol, { alignItems: "stretch", marginBottom: 0.5, onClick: () => setIsOpen(!isOpen), children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle2", children: event }),
105
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { marginBottom: 0.5, variant: "caption", children: JSON.stringify(fields, null, 2) }),
106
+ events[index + 1] && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Divider, {})
107
+ ] });
108
+ };
109
+
110
+ // src/components/PixelDebuggerProvider.tsx
111
+ var import_react_pixel2 = require("@xylabs/react-pixel");
112
+ var import_react_shared = require("@xylabs/react-shared");
113
+ var import_jsx_runtime2 = require("react/jsx-runtime");
114
+ var PixelDebuggerProvider = ({ children }) => {
115
+ const [isDebugging, setIsDebugging] = (0, import_react_shared.useLocalStorage)("isDebuggingPixel", false);
116
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_pixel2.DebugUserEventsContext.Provider, { value: { isDebugging, setIsDebugging }, children });
117
+ };
118
+
119
+ // src/components/PixelDebuggerToggle.tsx
120
+ var import_material2 = require("@mui/material");
121
+ var import_react_flexbox2 = require("@xylabs/react-flexbox");
122
+ var import_react_pixel3 = require("@xylabs/react-pixel");
123
+ var import_react3 = require("react");
124
+ var import_jsx_runtime3 = require("react/jsx-runtime");
125
+ var PixelDebuggerToggle = ({ ...props }) => {
126
+ const { setIsDebugging, isDebugging } = (0, import_react3.useContext)(import_react_pixel3.DebugUserEventsContext);
127
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_flexbox2.FlexRow, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material2.FormControl, { children: [
128
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.FormLabel, { children: "Enable Debugger" }),
129
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Switch, { checked: isDebugging, onClick: () => setIsDebugging(!isDebugging) })
130
+ ] }) });
131
+ };
132
+ // Annotate the CommonJS export names for ESM import in node:
133
+ 0 && (module.exports = {
134
+ PixelDebugger,
135
+ PixelDebuggerProvider,
136
+ PixelDebuggerToggle
137
+ });
138
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/index.ts","../../../src/components/PixelDebugger.tsx","../../../src/hooks/usePixelAltSendHandler.ts","../../../src/components/PixelDebuggerProvider.tsx","../../../src/components/PixelDebuggerToggle.tsx"],"sourcesContent":["export * from './PixelDebugger'\nexport * from './PixelDebuggerProvider'\nexport * from './PixelDebuggerToggle'\n","import { Badge, Card, Divider, Typography, useTheme } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { DebugUserEventsContext } from '@xylabs/react-pixel'\nimport { Portal } from '@xylabs/react-portal'\nimport { useContext, useState } from 'react'\n\nimport { usePixelAltSendHandler } from '../hooks'\nimport { PixelEvent } from '../PixelEvent'\n\nexport const PixelDebugger: React.FC = () => {\n const { isDebugging } = useContext(DebugUserEventsContext)\n //TODO - when adding in the location hook to detect location change, was dropping the setEvents in usePixelAltSendHand\n const theme = useTheme()\n const [displayEvents, setDisplayEvents] = useState(false)\n const [events, setEvents] = useState<PixelEvent[]>([])\n\n usePixelAltSendHandler((event: string, fields?: Record<string, unknown>) => {\n setEvents((events) => [{ event, fields }, ...events])\n })\n\n if (!isDebugging) {\n return null\n }\n\n return (\n <Portal>\n <div style={{ bottom: 0, left: 0, position: 'fixed', width: 350 }}>\n <Badge badgeContent={events.length} color=\"primary\" sx={{ width: '100%' }}>\n <Card\n variant=\"outlined\"\n sx={{\n backdropFilter: 'blur(16px) saturate(180%)',\n backgroundColor: 'rgba(18, 18, 18, .70)',\n overflowY: 'auto',\n width: '100%',\n }}\n color={theme.palette.primary.main}\n >\n <FlexCol alignItems=\"stretch\" sx={{ flexFlow: 'column', maxHeight: 400 }}>\n <FlexCol alignItems=\"stretch\" sx={{ flex: '0 1 auto' }}>\n <ButtonEx variant=\"text\" onClick={() => setDisplayEvents(!displayEvents)}>\n XY Pixel Debugger\n </ButtonEx>\n </FlexCol>\n {displayEvents && !!events.length && (\n <FlexCol\n alignItems=\"stretch\"\n alignContent=\"start\"\n padding={2}\n sx={{ cursor: 'pointer', flex: '1 1 auto', overflowY: 'auto', userSelect: 'none' }}\n >\n {events.map((e, index) => (\n <PixelEventDetails key={`${e.event}-${index}`} events={events} index={index} {...e} />\n ))}\n </FlexCol>\n )}\n {displayEvents && !events.length && <Typography variant=\"subtitle2\">No Events</Typography>}\n </FlexCol>\n </Card>\n </Badge>\n </div>\n </Portal>\n )\n}\n\nconst PixelEventDetails: React.FC<PixelEvent & { events: PixelEvent[]; index: number }> = ({ event, fields, index, events }) => {\n const [isOpen, setIsOpen] = useState(false)\n return (\n <FlexCol alignItems=\"stretch\" marginBottom={0.5} onClick={() => setIsOpen(!isOpen)}>\n <Typography variant=\"subtitle2\">{event}</Typography>\n {isOpen && (\n <Typography marginBottom={0.5} variant=\"caption\">\n {JSON.stringify(fields, null, 2)}\n </Typography>\n )}\n {events[index + 1] && <Divider />}\n </FlexCol>\n )\n}\n","import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n","import { DebugUserEventsContext } from '@xylabs/react-pixel'\nimport { useLocalStorage, WithChildren } from '@xylabs/react-shared'\n\nexport const PixelDebuggerProvider: React.FC<WithChildren> = ({ children }) => {\n const [isDebugging, setIsDebugging] = useLocalStorage<boolean>('isDebuggingPixel', false)\n return <DebugUserEventsContext.Provider value={{ isDebugging, setIsDebugging }}>{children}</DebugUserEventsContext.Provider>\n}\n","import { FormControl, FormLabel, Switch } from '@mui/material'\nimport { BusyBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { DebugUserEventsContext } from '@xylabs/react-pixel'\nimport { useContext } from 'react'\n\nexport const PixelDebuggerToggle: React.FC<BusyBoxProps> = ({ ...props }) => {\n const { setIsDebugging, isDebugging } = useContext(DebugUserEventsContext)\n\n return (\n <FlexRow {...props}>\n <FormControl>\n <FormLabel>Enable Debugger</FormLabel>\n <Switch checked={isDebugging} onClick={() => setIsDebugging(!isDebugging)} />\n </FormControl>\n </FlexRow>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sBAA2D;AAC3D,0BAAyB;AACzB,2BAAwB;AACxB,yBAAuC;AACvC,0BAAuB;AACvB,IAAAA,gBAAqC;;;ACLrC,mBAAwB;AACxB,mBAAoC;AAE7B,IAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAuC;AACzE,8BAAU,MAAM;AACd,QAAI,CAAC,aAAa,qBAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,qBAAQ,SA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C,IAAAC,wBAAsC;AACtC,IAAAC,sBAAuC;AACvC,IAAAC,gBAA2B;AAOrB,IAAAC,sBAAA;AALC,IAAM,sBAA8C,CAAC,EAAE,GAAG,MAAM,MAAM;AAC3E,QAAM,EAAE,gBAAgB,YAAY,QAAI,0BAAW,0CAAsB;AAEzE,SACE,6CAAC,iCAAS,GAAG,OACX,wDAAC,gCACC;AAAA,iDAAC,8BAAU,6BAAe;AAAA,IAC1B,6CAAC,2BAAO,SAAS,aAAa,SAAS,MAAM,eAAe,CAAC,WAAW,GAAG;AAAA,KAC7E,GACF;AAEJ;","names":["import_react","events","import_react_pixel","import_jsx_runtime","import_material","import_react_flexbox","import_react_pixel","import_react","import_jsx_runtime"]}
@@ -0,0 +1,4 @@
1
+ export * from './PixelDebugger';
2
+ export * from './PixelDebuggerProvider';
3
+ export * from './PixelDebuggerToggle';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA"}
@@ -1,27 +1,109 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
1
+ // src/components/PixelDebugger.tsx
2
+ import { Badge, Card, Divider, Typography, useTheme } from "@mui/material";
3
+ import { ButtonEx } from "@xylabs/react-button";
4
+ import { FlexCol } from "@xylabs/react-flexbox";
5
+ import { DebugUserEventsContext } from "@xylabs/react-pixel";
6
+ import { Portal } from "@xylabs/react-portal";
7
+ import { useContext, useState as useState2 } from "react";
8
+
9
+ // src/hooks/usePixelAltSendHandler.ts
10
+ import { XyPixel } from "@xylabs/pixel";
11
+ import { useEffect, useState } from "react";
12
+ var usePixelAltSendHandler = (altHandler) => {
13
+ const [pixelSend, setPixelSend] = useState();
14
+ useEffect(() => {
15
+ if (!pixelSend && XyPixel.instance.send) {
16
+ const oldHandler = XyPixel.instance.send.bind(XyPixel.instance);
17
+ setPixelSend(oldHandler);
18
+ } else {
19
+ XyPixel.instance.send = async (event, fields, eventId) => {
20
+ altHandler(event, fields);
21
+ return await (pixelSend == null ? void 0 : pixelSend(event, fields, eventId));
22
+ };
23
+ }
24
+ return () => {
25
+ if (pixelSend) {
26
+ XyPixel.instance.send = pixelSend;
27
+ }
28
+ };
29
+ }, [pixelSend, altHandler]);
30
+ };
31
+
32
+ // src/components/PixelDebugger.tsx
33
+ import { jsx, jsxs } from "react/jsx-runtime";
34
+ var PixelDebugger = () => {
35
+ const { isDebugging } = useContext(DebugUserEventsContext);
36
+ const theme = useTheme();
37
+ const [displayEvents, setDisplayEvents] = useState2(false);
38
+ const [events, setEvents] = useState2([]);
39
+ usePixelAltSendHandler((event, fields) => {
40
+ setEvents((events2) => [{ event, fields }, ...events2]);
41
+ });
42
+ if (!isDebugging) {
43
+ return null;
11
44
  }
12
- return to;
45
+ return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx("div", { style: { bottom: 0, left: 0, position: "fixed", width: 350 }, children: /* @__PURE__ */ jsx(Badge, { badgeContent: events.length, color: "primary", sx: { width: "100%" }, children: /* @__PURE__ */ jsx(
46
+ Card,
47
+ {
48
+ variant: "outlined",
49
+ sx: {
50
+ backdropFilter: "blur(16px) saturate(180%)",
51
+ backgroundColor: "rgba(18, 18, 18, .70)",
52
+ overflowY: "auto",
53
+ width: "100%"
54
+ },
55
+ color: theme.palette.primary.main,
56
+ children: /* @__PURE__ */ jsxs(FlexCol, { alignItems: "stretch", sx: { flexFlow: "column", maxHeight: 400 }, children: [
57
+ /* @__PURE__ */ jsx(FlexCol, { alignItems: "stretch", sx: { flex: "0 1 auto" }, children: /* @__PURE__ */ jsx(ButtonEx, { variant: "text", onClick: () => setDisplayEvents(!displayEvents), children: "XY Pixel Debugger" }) }),
58
+ displayEvents && !!events.length && /* @__PURE__ */ jsx(
59
+ FlexCol,
60
+ {
61
+ alignItems: "stretch",
62
+ alignContent: "start",
63
+ padding: 2,
64
+ sx: { cursor: "pointer", flex: "1 1 auto", overflowY: "auto", userSelect: "none" },
65
+ children: events.map((e, index) => /* @__PURE__ */ jsx(PixelEventDetails, { events, index, ...e }, `${e.event}-${index}`))
66
+ }
67
+ ),
68
+ displayEvents && !events.length && /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "No Events" })
69
+ ] })
70
+ }
71
+ ) }) }) });
72
+ };
73
+ var PixelEventDetails = ({ event, fields, index, events }) => {
74
+ const [isOpen, setIsOpen] = useState2(false);
75
+ return /* @__PURE__ */ jsxs(FlexCol, { alignItems: "stretch", marginBottom: 0.5, onClick: () => setIsOpen(!isOpen), children: [
76
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: event }),
77
+ isOpen && /* @__PURE__ */ jsx(Typography, { marginBottom: 0.5, variant: "caption", children: JSON.stringify(fields, null, 2) }),
78
+ events[index + 1] && /* @__PURE__ */ jsx(Divider, {})
79
+ ] });
80
+ };
81
+
82
+ // src/components/PixelDebuggerProvider.tsx
83
+ import { DebugUserEventsContext as DebugUserEventsContext2 } from "@xylabs/react-pixel";
84
+ import { useLocalStorage } from "@xylabs/react-shared";
85
+ import { jsx as jsx2 } from "react/jsx-runtime";
86
+ var PixelDebuggerProvider = ({ children }) => {
87
+ const [isDebugging, setIsDebugging] = useLocalStorage("isDebuggingPixel", false);
88
+ return /* @__PURE__ */ jsx2(DebugUserEventsContext2.Provider, { value: { isDebugging, setIsDebugging }, children });
89
+ };
90
+
91
+ // src/components/PixelDebuggerToggle.tsx
92
+ import { FormControl, FormLabel, Switch } from "@mui/material";
93
+ import { FlexRow } from "@xylabs/react-flexbox";
94
+ import { DebugUserEventsContext as DebugUserEventsContext3 } from "@xylabs/react-pixel";
95
+ import { useContext as useContext2 } from "react";
96
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
97
+ var PixelDebuggerToggle = ({ ...props }) => {
98
+ const { setIsDebugging, isDebugging } = useContext2(DebugUserEventsContext3);
99
+ return /* @__PURE__ */ jsx3(FlexRow, { ...props, children: /* @__PURE__ */ jsxs2(FormControl, { children: [
100
+ /* @__PURE__ */ jsx3(FormLabel, { children: "Enable Debugger" }),
101
+ /* @__PURE__ */ jsx3(Switch, { checked: isDebugging, onClick: () => setIsDebugging(!isDebugging) })
102
+ ] }) });
103
+ };
104
+ export {
105
+ PixelDebugger,
106
+ PixelDebuggerProvider,
107
+ PixelDebuggerToggle
13
108
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var components_exports = {};
17
- module.exports = __toCommonJS(components_exports);
18
- __reExport(components_exports, require("./PixelDebugger"), module.exports);
19
- __reExport(components_exports, require("./PixelDebuggerProvider"), module.exports);
20
- __reExport(components_exports, require("./PixelDebuggerToggle"), module.exports);
21
- // Annotate the CommonJS export names for ESM import in node:
22
- 0 && (module.exports = {
23
- ...require("./PixelDebugger"),
24
- ...require("./PixelDebuggerProvider"),
25
- ...require("./PixelDebuggerToggle")
26
- });
27
109
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './PixelDebugger'\nexport * from './PixelDebuggerProvider'\nexport * from './PixelDebuggerToggle'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,4BAAd;AACA,+BAAc,oCADd;AAEA,+BAAc,kCAFd;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/PixelDebugger.tsx","../../../src/hooks/usePixelAltSendHandler.ts","../../../src/components/PixelDebuggerProvider.tsx","../../../src/components/PixelDebuggerToggle.tsx"],"sourcesContent":["import { Badge, Card, Divider, Typography, useTheme } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { DebugUserEventsContext } from '@xylabs/react-pixel'\nimport { Portal } from '@xylabs/react-portal'\nimport { useContext, useState } from 'react'\n\nimport { usePixelAltSendHandler } from '../hooks'\nimport { PixelEvent } from '../PixelEvent'\n\nexport const PixelDebugger: React.FC = () => {\n const { isDebugging } = useContext(DebugUserEventsContext)\n //TODO - when adding in the location hook to detect location change, was dropping the setEvents in usePixelAltSendHand\n const theme = useTheme()\n const [displayEvents, setDisplayEvents] = useState(false)\n const [events, setEvents] = useState<PixelEvent[]>([])\n\n usePixelAltSendHandler((event: string, fields?: Record<string, unknown>) => {\n setEvents((events) => [{ event, fields }, ...events])\n })\n\n if (!isDebugging) {\n return null\n }\n\n return (\n <Portal>\n <div style={{ bottom: 0, left: 0, position: 'fixed', width: 350 }}>\n <Badge badgeContent={events.length} color=\"primary\" sx={{ width: '100%' }}>\n <Card\n variant=\"outlined\"\n sx={{\n backdropFilter: 'blur(16px) saturate(180%)',\n backgroundColor: 'rgba(18, 18, 18, .70)',\n overflowY: 'auto',\n width: '100%',\n }}\n color={theme.palette.primary.main}\n >\n <FlexCol alignItems=\"stretch\" sx={{ flexFlow: 'column', maxHeight: 400 }}>\n <FlexCol alignItems=\"stretch\" sx={{ flex: '0 1 auto' }}>\n <ButtonEx variant=\"text\" onClick={() => setDisplayEvents(!displayEvents)}>\n XY Pixel Debugger\n </ButtonEx>\n </FlexCol>\n {displayEvents && !!events.length && (\n <FlexCol\n alignItems=\"stretch\"\n alignContent=\"start\"\n padding={2}\n sx={{ cursor: 'pointer', flex: '1 1 auto', overflowY: 'auto', userSelect: 'none' }}\n >\n {events.map((e, index) => (\n <PixelEventDetails key={`${e.event}-${index}`} events={events} index={index} {...e} />\n ))}\n </FlexCol>\n )}\n {displayEvents && !events.length && <Typography variant=\"subtitle2\">No Events</Typography>}\n </FlexCol>\n </Card>\n </Badge>\n </div>\n </Portal>\n )\n}\n\nconst PixelEventDetails: React.FC<PixelEvent & { events: PixelEvent[]; index: number }> = ({ event, fields, index, events }) => {\n const [isOpen, setIsOpen] = useState(false)\n return (\n <FlexCol alignItems=\"stretch\" marginBottom={0.5} onClick={() => setIsOpen(!isOpen)}>\n <Typography variant=\"subtitle2\">{event}</Typography>\n {isOpen && (\n <Typography marginBottom={0.5} variant=\"caption\">\n {JSON.stringify(fields, null, 2)}\n </Typography>\n )}\n {events[index + 1] && <Divider />}\n </FlexCol>\n )\n}\n","import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n","import { DebugUserEventsContext } from '@xylabs/react-pixel'\nimport { useLocalStorage, WithChildren } from '@xylabs/react-shared'\n\nexport const PixelDebuggerProvider: React.FC<WithChildren> = ({ children }) => {\n const [isDebugging, setIsDebugging] = useLocalStorage<boolean>('isDebuggingPixel', false)\n return <DebugUserEventsContext.Provider value={{ isDebugging, setIsDebugging }}>{children}</DebugUserEventsContext.Provider>\n}\n","import { FormControl, FormLabel, Switch } from '@mui/material'\nimport { BusyBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { DebugUserEventsContext } from '@xylabs/react-pixel'\nimport { useContext } from 'react'\n\nexport const PixelDebuggerToggle: React.FC<BusyBoxProps> = ({ ...props }) => {\n const { setIsDebugging, isDebugging } = useContext(DebugUserEventsContext)\n\n return (\n <FlexRow {...props}>\n <FormControl>\n <FormLabel>Enable Debugger</FormLabel>\n <Switch checked={isDebugging} onClick={() => setIsDebugging(!isDebugging)} />\n </FormControl>\n </FlexRow>\n )\n}\n"],"mappings":";AAAA,SAAS,OAAO,MAAM,SAAS,YAAY,gBAAgB;AAC3D,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,8BAA8B;AACvC,SAAS,cAAc;AACvB,SAAS,YAAY,YAAAA,iBAAgB;;;ACLrC,SAAS,eAAe;AACxB,SAAS,WAAW,gBAAgB;AAE7B,IAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,IAAI,SAAuC;AACzE,YAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,QAAQ,SAAS,KAAK,KAAK,QAAQ,QAAQ;AAC9D,mBAAa,UAAU;AAAA,IACzB,OAAO;AACL,cAAQ,SAAS,OAAO,OAAO,OAAe,QAAkC,YAAqB;AACnG,mBAAW,OAAO,MAAM;AACxB,eAAO,OAAM,uCAAY,OAAO,QAAQ;AAAA,MAC1C;AAAA,IACF;AACA,WAAO,MAAM;AAEX,UAAI,WAAW;AACb,gBAAQ,SAAS,OAAO;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAC5B;;;ADiBY,SAEI,KAFJ;AA7BL,IAAM,gBAA0B,MAAM;AAC3C,QAAM,EAAE,YAAY,IAAI,WAAW,sBAAsB;AAEzD,QAAM,QAAQ,SAAS;AACvB,QAAM,CAAC,eAAe,gBAAgB,IAAIC,UAAS,KAAK;AACxD,QAAM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@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/hooks/index.ts
21
+ var hooks_exports = {};
22
+ __export(hooks_exports, {
23
+ usePixelAltSendHandler: () => usePixelAltSendHandler
24
+ });
25
+ module.exports = __toCommonJS(hooks_exports);
26
+
27
+ // src/hooks/usePixelAltSendHandler.ts
28
+ var import_pixel = require("@xylabs/pixel");
29
+ var import_react = require("react");
30
+ var usePixelAltSendHandler = (altHandler) => {
31
+ const [pixelSend, setPixelSend] = (0, import_react.useState)();
32
+ (0, import_react.useEffect)(() => {
33
+ if (!pixelSend && import_pixel.XyPixel.instance.send) {
34
+ const oldHandler = import_pixel.XyPixel.instance.send.bind(import_pixel.XyPixel.instance);
35
+ setPixelSend(oldHandler);
36
+ } else {
37
+ import_pixel.XyPixel.instance.send = async (event, fields, eventId) => {
38
+ altHandler(event, fields);
39
+ return await (pixelSend == null ? void 0 : pixelSend(event, fields, eventId));
40
+ };
41
+ }
42
+ return () => {
43
+ if (pixelSend) {
44
+ import_pixel.XyPixel.instance.send = pixelSend;
45
+ }
46
+ };
47
+ }, [pixelSend, altHandler]);
48
+ };
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ usePixelAltSendHandler
52
+ });
53
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/hooks/index.ts","../../../src/hooks/usePixelAltSendHandler.ts"],"sourcesContent":["export * from './usePixelAltSendHandler'\n","import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAwB;AACxB,mBAAoC;AAE7B,IAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAuC;AACzE,8BAAU,MAAM;AACd,QAAI,CAAC,aAAa,qBAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,qBAAQ,SAAS,KAAK,KAAK,qBAAQ,QAAQ;AAC9D,mBAAa,UAAU;AAAA,IACzB,OAAO;AACL,2BAAQ,SAAS,OAAO,OAAO,OAAe,QAAkC,YAAqB;AACnG,mBAAW,OAAO,MAAM;AACxB,eAAO,OAAM,uCAAY,OAAO,QAAQ;AAAA,MAC1C;AAAA,IACF;AACA,WAAO,MAAM;AAEX,UAAI,WAAW;AACb,6BAAQ,SAAS,OAAO;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAC5B;","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from './usePixelAltSendHandler';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
@@ -1,23 +1,26 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
1
+ // src/hooks/usePixelAltSendHandler.ts
2
+ import { XyPixel } from "@xylabs/pixel";
3
+ import { useEffect, useState } from "react";
4
+ var usePixelAltSendHandler = (altHandler) => {
5
+ const [pixelSend, setPixelSend] = useState();
6
+ useEffect(() => {
7
+ if (!pixelSend && XyPixel.instance.send) {
8
+ const oldHandler = XyPixel.instance.send.bind(XyPixel.instance);
9
+ setPixelSend(oldHandler);
10
+ } else {
11
+ XyPixel.instance.send = async (event, fields, eventId) => {
12
+ altHandler(event, fields);
13
+ return await (pixelSend == null ? void 0 : pixelSend(event, fields, eventId));
14
+ };
15
+ }
16
+ return () => {
17
+ if (pixelSend) {
18
+ XyPixel.instance.send = pixelSend;
19
+ }
20
+ };
21
+ }, [pixelSend, altHandler]);
22
+ };
23
+ export {
24
+ usePixelAltSendHandler
13
25
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var hooks_exports = {};
17
- module.exports = __toCommonJS(hooks_exports);
18
- __reExport(hooks_exports, require("./usePixelAltSendHandler"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./usePixelAltSendHandler")
22
- });
23
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './usePixelAltSendHandler'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,qCAAd;","names":[]}
1
+ {"version":3,"sources":["../../../src/hooks/usePixelAltSendHandler.ts"],"sourcesContent":["import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,WAAW,gBAAgB;AAE7B,IAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,IAAI,SAAuC;AACzE,YAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,QAAQ,SAAS,KAAK,KAAK,QAAQ,QAAQ;AAC9D,mBAAa,UAAU;AAAA,IACzB,OAAO;AACL,cAAQ,SAAS,OAAO,OAAO,OAAe,QAAkC,YAAqB;AACnG,mBAAW,OAAO,MAAM;AACxB,eAAO,OAAM,uCAAY,OAAO,QAAQ;AAAA,MAC1C;AAAA,IACF;AACA,WAAO,MAAM;AAEX,UAAI,WAAW;AACb,gBAAQ,SAAS,OAAO;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAC5B;","names":[]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/hooks/usePixelAltSendHandler.ts
21
+ var usePixelAltSendHandler_exports = {};
22
+ __export(usePixelAltSendHandler_exports, {
23
+ usePixelAltSendHandler: () => usePixelAltSendHandler
24
+ });
25
+ module.exports = __toCommonJS(usePixelAltSendHandler_exports);
26
+ var import_pixel = require("@xylabs/pixel");
27
+ var import_react = require("react");
28
+ var usePixelAltSendHandler = (altHandler) => {
29
+ const [pixelSend, setPixelSend] = (0, import_react.useState)();
30
+ (0, import_react.useEffect)(() => {
31
+ if (!pixelSend && import_pixel.XyPixel.instance.send) {
32
+ const oldHandler = import_pixel.XyPixel.instance.send.bind(import_pixel.XyPixel.instance);
33
+ setPixelSend(oldHandler);
34
+ } else {
35
+ import_pixel.XyPixel.instance.send = async (event, fields, eventId) => {
36
+ altHandler(event, fields);
37
+ return await (pixelSend == null ? void 0 : pixelSend(event, fields, eventId));
38
+ };
39
+ }
40
+ return () => {
41
+ if (pixelSend) {
42
+ import_pixel.XyPixel.instance.send = pixelSend;
43
+ }
44
+ };
45
+ }, [pixelSend, altHandler]);
46
+ };
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ usePixelAltSendHandler
50
+ });
51
+ //# sourceMappingURL=usePixelAltSendHandler.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/hooks/usePixelAltSendHandler.ts"],"sourcesContent":["import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,SAAS,WAAW,gBAAgB;AAE7B,MAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,IAAI,SAAuC;AACzE,YAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,QAAQ,SAAS,KAAK,KAAK,QAAQ,QAAQ;AAC9D,mBAAa,UAAU;AAAA,IACzB,OAAO;AACL,cAAQ,SAAS,OAAO,OAAO,OAAe,QAAkC,YAAqB;AACnG,mBAAW,OAAO,MAAM;AACxB,eAAO,MAAM,YAAY,OAAO,QAAQ,OAAO;AAAA,MACjD;AAAA,IACF;AACA,WAAO,MAAM;AAEX,UAAI,WAAW;AACb,gBAAQ,SAAS,OAAO;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAC5B;","names":[]}
1
+ {"version":3,"sources":["../../../src/hooks/usePixelAltSendHandler.ts"],"sourcesContent":["import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwB;AACxB,mBAAoC;AAE7B,IAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAuC;AACzE,8BAAU,MAAM;AACd,QAAI,CAAC,aAAa,qBAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,qBAAQ,SAAS,KAAK,KAAK,qBAAQ,QAAQ;AAC9D,mBAAa,UAAU;AAAA,IACzB,OAAO;AACL,2BAAQ,SAAS,OAAO,OAAO,OAAe,QAAkC,YAAqB;AACnG,mBAAW,OAAO,MAAM;AACxB,eAAO,OAAM,uCAAY,OAAO,QAAQ;AAAA,MAC1C;AAAA,IACF;AACA,WAAO,MAAM;AAEX,UAAI,WAAW;AACb,6BAAQ,SAAS,OAAO;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAC5B;","names":[]}
@@ -0,0 +1,2 @@
1
+ export declare const usePixelAltSendHandler: (altHandler: (event: string, fields?: Record<string, unknown>) => void) => void;
2
+ //# sourceMappingURL=usePixelAltSendHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePixelAltSendHandler.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePixelAltSendHandler.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,uBAAwB,MAAM,WAAW,OAAO,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,SAmB3G,CAAA"}
@@ -1,49 +1,26 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var usePixelAltSendHandler_exports = {};
20
- __export(usePixelAltSendHandler_exports, {
21
- usePixelAltSendHandler: () => usePixelAltSendHandler
22
- });
23
- module.exports = __toCommonJS(usePixelAltSendHandler_exports);
24
- var import_pixel = require("@xylabs/pixel");
25
- var import_react = require("react");
26
- const usePixelAltSendHandler = (altHandler) => {
27
- const [pixelSend, setPixelSend] = (0, import_react.useState)();
28
- (0, import_react.useEffect)(() => {
29
- if (!pixelSend && import_pixel.XyPixel.instance.send) {
30
- const oldHandler = import_pixel.XyPixel.instance.send.bind(import_pixel.XyPixel.instance);
1
+ // src/hooks/usePixelAltSendHandler.ts
2
+ import { XyPixel } from "@xylabs/pixel";
3
+ import { useEffect, useState } from "react";
4
+ var usePixelAltSendHandler = (altHandler) => {
5
+ const [pixelSend, setPixelSend] = useState();
6
+ useEffect(() => {
7
+ if (!pixelSend && XyPixel.instance.send) {
8
+ const oldHandler = XyPixel.instance.send.bind(XyPixel.instance);
31
9
  setPixelSend(oldHandler);
32
10
  } else {
33
- import_pixel.XyPixel.instance.send = async (event, fields, eventId) => {
11
+ XyPixel.instance.send = async (event, fields, eventId) => {
34
12
  altHandler(event, fields);
35
- return await pixelSend?.(event, fields, eventId);
13
+ return await (pixelSend == null ? void 0 : pixelSend(event, fields, eventId));
36
14
  };
37
15
  }
38
16
  return () => {
39
17
  if (pixelSend) {
40
- import_pixel.XyPixel.instance.send = pixelSend;
18
+ XyPixel.instance.send = pixelSend;
41
19
  }
42
20
  };
43
21
  }, [pixelSend, altHandler]);
44
22
  };
45
- // Annotate the CommonJS export names for ESM import in node:
46
- 0 && (module.exports = {
23
+ export {
47
24
  usePixelAltSendHandler
48
- });
25
+ };
49
26
  //# sourceMappingURL=usePixelAltSendHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/hooks/usePixelAltSendHandler.ts"],"sourcesContent":["import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwB;AACxB,mBAAoC;AAE7B,MAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAuC;AACzE,8BAAU,MAAM;AACd,QAAI,CAAC,aAAa,qBAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,qBAAQ,SAAS,KAAK,KAAK,qBAAQ,QAAQ;AAC9D,mBAAa,UAAU;AAAA,IACzB,OAAO;AACL,2BAAQ,SAAS,OAAO,OAAO,OAAe,QAAkC,YAAqB;AACnG,mBAAW,OAAO,MAAM;AACxB,eAAO,MAAM,YAAY,OAAO,QAAQ,OAAO;AAAA,MACjD;AAAA,IACF;AACA,WAAO,MAAM;AAEX,UAAI,WAAW;AACb,6BAAQ,SAAS,OAAO;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAC5B;","names":[]}
1
+ {"version":3,"sources":["../../../src/hooks/usePixelAltSendHandler.ts"],"sourcesContent":["import { XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nexport const usePixelAltSendHandler = (altHandler: (event: string, fields?: Record<string, unknown>) => void) => {\n const [pixelSend, setPixelSend] = useState<typeof XyPixel.instance.send>()\n useEffect(() => {\n if (!pixelSend && XyPixel.instance.send) {\n const oldHandler = XyPixel.instance.send.bind(XyPixel.instance)\n setPixelSend(oldHandler)\n } else {\n XyPixel.instance.send = async (event: string, fields?: Record<string, unknown>, eventId?: string) => {\n altHandler(event, fields)\n return await pixelSend?.(event, fields, eventId)\n }\n }\n return () => {\n //restore send on unmount\n if (pixelSend) {\n XyPixel.instance.send = pixelSend\n }\n }\n }, [pixelSend, altHandler])\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,WAAW,gBAAgB;AAE7B,IAAM,yBAAyB,CAAC,eAA0E;AAC/G,QAAM,CAAC,WAAW,YAAY,IAAI,SAAuC;AACzE,YAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAQ,SAAS,MAAM;AACvC,YAAM,aAAa,QAAQ,SAAS,KAAK,KAAK,QAAQ,QAAQ;AAC9D,mBAAa,UAAU;AAAA,IACzB,OAAO;AACL,cAAQ,SAAS,OAAO,OAAO,OAAe,QAAkC,YAAqB;AACnG,mBAAW,OAAO,MAAM;AACxB,eAAO,OAAM,uCAAY,OAAO,QAAQ;AAAA,MAC1C;AAAA,IACF;AACA,WAAO,MAAM;AAEX,UAAI,WAAW;AACb,gBAAQ,SAAS,OAAO;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,CAAC;AAC5B;","names":[]}