@xylabs/react-pixel-debugger 3.1.0-rc.3 → 3.1.0-rc.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/PixelEvent.js +17 -0
- package/dist/PixelEvent.js.map +1 -0
- package/dist/PixelEvent.mjs +1 -0
- package/dist/PixelEvent.mjs.map +1 -0
- package/dist/components/PixelDebugger.js +83 -0
- package/dist/components/PixelDebugger.js.map +1 -0
- package/dist/components/PixelDebugger.mjs +59 -0
- package/dist/components/PixelDebugger.mjs.map +1 -0
- package/dist/components/PixelDebugger.stories.js +58 -0
- package/dist/components/PixelDebugger.stories.js.map +1 -0
- package/dist/components/PixelDebugger.stories.mjs +34 -0
- package/dist/components/PixelDebugger.stories.mjs.map +1 -0
- package/dist/components/PixelDebuggerProvider.js +35 -0
- package/dist/components/PixelDebuggerProvider.js.map +1 -0
- package/dist/components/PixelDebuggerProvider.mjs +11 -0
- package/dist/components/PixelDebuggerProvider.mjs.map +1 -0
- package/dist/components/PixelDebuggerToggle.js +40 -0
- package/dist/components/PixelDebuggerToggle.js.map +1 -0
- package/dist/components/PixelDebuggerToggle.mjs +16 -0
- package/dist/components/PixelDebuggerToggle.mjs.map +1 -0
- package/dist/components/index.js +27 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +4 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/esm/PixelEvent.d.ts +5 -0
- package/dist/esm/PixelEvent.d.ts.map +1 -0
- package/dist/esm/PixelEvent.js +1 -0
- package/dist/esm/PixelEvent.js.map +1 -0
- package/dist/esm/components/PixelDebugger.d.ts +3 -0
- package/dist/esm/components/PixelDebugger.d.ts.map +1 -0
- package/dist/esm/components/PixelDebugger.js +59 -0
- package/dist/esm/components/PixelDebugger.js.map +1 -0
- package/dist/esm/components/PixelDebugger.stories.d.ts +5 -0
- package/dist/esm/components/PixelDebugger.stories.d.ts.map +1 -0
- package/dist/esm/components/PixelDebugger.stories.js +34 -0
- package/dist/esm/components/PixelDebugger.stories.js.map +1 -0
- package/dist/esm/components/PixelDebuggerProvider.d.ts +4 -0
- package/dist/esm/components/PixelDebuggerProvider.d.ts.map +1 -0
- package/dist/esm/components/PixelDebuggerProvider.js +11 -0
- package/dist/esm/components/PixelDebuggerProvider.js.map +1 -0
- package/dist/esm/components/PixelDebuggerToggle.d.ts +4 -0
- package/dist/esm/components/PixelDebuggerToggle.d.ts.map +1 -0
- package/dist/esm/components/PixelDebuggerToggle.js +16 -0
- package/dist/esm/components/PixelDebuggerToggle.js.map +1 -0
- package/dist/esm/components/index.d.ts +4 -0
- package/dist/esm/components/index.d.ts.map +1 -0
- package/dist/esm/components/index.js +4 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +2 -0
- package/dist/esm/hooks/index.d.ts.map +1 -0
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/usePixelAltSendHandler.d.ts +2 -0
- package/dist/esm/hooks/usePixelAltSendHandler.d.ts.map +1 -0
- package/dist/esm/hooks/usePixelAltSendHandler.js +25 -0
- package/dist/esm/hooks/usePixelAltSendHandler.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/hooks/index.js +23 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/usePixelAltSendHandler.js +49 -0
- package/dist/hooks/usePixelAltSendHandler.js.map +1 -0
- package/dist/hooks/usePixelAltSendHandler.mjs +25 -0
- package/dist/hooks/usePixelAltSendHandler.mjs.map +1 -0
- package/dist/index.js +7 -120
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -109
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var PixelEvent_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(PixelEvent_exports);
|
|
17
|
+
//# sourceMappingURL=PixelEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/PixelEvent.ts"],"sourcesContent":["export interface PixelEvent {\n event: string\n fields?: unknown\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=PixelEvent.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
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 PixelDebugger_exports = {};
|
|
20
|
+
__export(PixelDebugger_exports, {
|
|
21
|
+
PixelDebugger: () => PixelDebugger
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(PixelDebugger_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_material = require("@mui/material");
|
|
26
|
+
var import_react_button = require("@xylabs/react-button");
|
|
27
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
28
|
+
var import_react_pixel = require("@xylabs/react-pixel");
|
|
29
|
+
var import_react_portal = require("@xylabs/react-portal");
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var import_hooks = require("../hooks");
|
|
32
|
+
const PixelDebugger = () => {
|
|
33
|
+
const { isDebugging } = (0, import_react.useContext)(import_react_pixel.DebugUserEventsContext);
|
|
34
|
+
const theme = (0, import_material.useTheme)();
|
|
35
|
+
const [displayEvents, setDisplayEvents] = (0, import_react.useState)(false);
|
|
36
|
+
const [events, setEvents] = (0, import_react.useState)([]);
|
|
37
|
+
(0, import_hooks.usePixelAltSendHandler)((event, fields) => {
|
|
38
|
+
setEvents((events2) => [{ event, fields }, ...events2]);
|
|
39
|
+
});
|
|
40
|
+
if (!isDebugging) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
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)(
|
|
44
|
+
import_material.Card,
|
|
45
|
+
{
|
|
46
|
+
variant: "outlined",
|
|
47
|
+
sx: {
|
|
48
|
+
backdropFilter: "blur(16px) saturate(180%)",
|
|
49
|
+
backgroundColor: "rgba(18, 18, 18, .70)",
|
|
50
|
+
overflowY: "auto",
|
|
51
|
+
width: "100%"
|
|
52
|
+
},
|
|
53
|
+
color: theme.palette.primary.main,
|
|
54
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexCol, { alignItems: "stretch", sx: { flexFlow: "column", maxHeight: 400 }, children: [
|
|
55
|
+
/* @__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" }) }),
|
|
56
|
+
displayEvents && !!events.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_react_flexbox.FlexCol,
|
|
58
|
+
{
|
|
59
|
+
alignItems: "stretch",
|
|
60
|
+
alignContent: "start",
|
|
61
|
+
padding: 2,
|
|
62
|
+
sx: { cursor: "pointer", flex: "1 1 auto", overflowY: "auto", userSelect: "none" },
|
|
63
|
+
children: events.map((e, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PixelEventDetails, { events, index, ...e }, `${e.event}-${index}`))
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
displayEvents && !events.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle2", children: "No Events" })
|
|
67
|
+
] })
|
|
68
|
+
}
|
|
69
|
+
) }) }) });
|
|
70
|
+
};
|
|
71
|
+
const PixelEventDetails = ({ event, fields, index, events }) => {
|
|
72
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexCol, { alignItems: "stretch", marginBottom: 0.5, onClick: () => setIsOpen(!isOpen), children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle2", children: event }),
|
|
75
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { marginBottom: 0.5, variant: "caption", children: JSON.stringify(fields, null, 2) }),
|
|
76
|
+
events[index + 1] && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Divider, {})
|
|
77
|
+
] });
|
|
78
|
+
};
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
PixelDebugger
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=PixelDebugger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebugger.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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCY;AAvCZ,sBAA2D;AAC3D,0BAAyB;AACzB,2BAAwB;AACxB,yBAAuC;AACvC,0BAAuB;AACvB,mBAAqC;AAErC,mBAAuC;AAGhC,MAAM,gBAA0B,MAAM;AAC3C,QAAM,EAAE,YAAY,QAAI,yBAAW,yCAAsB;AAEzD,QAAM,YAAQ,0BAAS;AACvB,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAS,KAAK;AACxD,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAuB,CAAC,CAAC;AAErD,2CAAuB,CAAC,OAAe,WAAqC;AAC1E,cAAU,CAACA,YAAW,CAAC,EAAE,OAAO,OAAO,GAAG,GAAGA,OAAM,CAAC;AAAA,EACtD,CAAC;AAED,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,SACE,4CAAC,8BACC,sDAAC,SAAI,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,SAAS,OAAO,IAAI,GAC9D,sDAAC,yBAAM,cAAc,OAAO,QAAQ,OAAM,WAAU,IAAI,EAAE,OAAO,OAAO,GACtE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,IAAI;AAAA,QACF,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QACjB,WAAW;AAAA,QACX,OAAO;AAAA,MACT;AAAA,MACA,OAAO,MAAM,QAAQ,QAAQ;AAAA,MAE7B,uDAAC,gCAAQ,YAAW,WAAU,IAAI,EAAE,UAAU,UAAU,WAAW,IAAI,GACrE;AAAA,oDAAC,gCAAQ,YAAW,WAAU,IAAI,EAAE,MAAM,WAAW,GACnD,sDAAC,gCAAS,SAAQ,QAAO,SAAS,MAAM,iBAAiB,CAAC,aAAa,GAAG,+BAE1E,GACF;AAAA,QACC,iBAAiB,CAAC,CAAC,OAAO,UACzB;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,cAAa;AAAA,YACb,SAAS;AAAA,YACT,IAAI,EAAE,QAAQ,WAAW,MAAM,YAAY,WAAW,QAAQ,YAAY,OAAO;AAAA,YAEhF,iBAAO,IAAI,CAAC,GAAG,UACd,4CAAC,qBAA8C,QAAgB,OAAe,GAAG,KAAzD,GAAG,EAAE,KAAK,IAAI,KAAK,EAAyC,CACrF;AAAA;AAAA,QACH;AAAA,QAED,iBAAiB,CAAC,OAAO,UAAU,4CAAC,8BAAW,SAAQ,aAAY,uBAAS;AAAA,SAC/E;AAAA;AAAA,EACF,GACF,GACF,GACF;AAEJ;AAEA,MAAM,oBAAoF,CAAC,EAAE,OAAO,QAAQ,OAAO,OAAO,MAAM;AAC9H,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,SACE,6CAAC,gCAAQ,YAAW,WAAU,cAAc,KAAK,SAAS,MAAM,UAAU,CAAC,MAAM,GAC/E;AAAA,gDAAC,8BAAW,SAAQ,aAAa,iBAAM;AAAA,IACtC,UACC,4CAAC,8BAAW,cAAc,KAAK,SAAQ,WACpC,eAAK,UAAU,QAAQ,MAAM,CAAC,GACjC;AAAA,IAED,OAAO,QAAQ,CAAC,KAAK,4CAAC,2BAAQ;AAAA,KACjC;AAEJ;","names":["events"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
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 } from "react";
|
|
8
|
+
import { usePixelAltSendHandler } from "../hooks";
|
|
9
|
+
const PixelDebugger = () => {
|
|
10
|
+
const { isDebugging } = useContext(DebugUserEventsContext);
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
const [displayEvents, setDisplayEvents] = useState(false);
|
|
13
|
+
const [events, setEvents] = useState([]);
|
|
14
|
+
usePixelAltSendHandler((event, fields) => {
|
|
15
|
+
setEvents((events2) => [{ event, fields }, ...events2]);
|
|
16
|
+
});
|
|
17
|
+
if (!isDebugging) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
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(
|
|
21
|
+
Card,
|
|
22
|
+
{
|
|
23
|
+
variant: "outlined",
|
|
24
|
+
sx: {
|
|
25
|
+
backdropFilter: "blur(16px) saturate(180%)",
|
|
26
|
+
backgroundColor: "rgba(18, 18, 18, .70)",
|
|
27
|
+
overflowY: "auto",
|
|
28
|
+
width: "100%"
|
|
29
|
+
},
|
|
30
|
+
color: theme.palette.primary.main,
|
|
31
|
+
children: /* @__PURE__ */ jsxs(FlexCol, { alignItems: "stretch", sx: { flexFlow: "column", maxHeight: 400 }, children: [
|
|
32
|
+
/* @__PURE__ */ jsx(FlexCol, { alignItems: "stretch", sx: { flex: "0 1 auto" }, children: /* @__PURE__ */ jsx(ButtonEx, { variant: "text", onClick: () => setDisplayEvents(!displayEvents), children: "XY Pixel Debugger" }) }),
|
|
33
|
+
displayEvents && !!events.length && /* @__PURE__ */ jsx(
|
|
34
|
+
FlexCol,
|
|
35
|
+
{
|
|
36
|
+
alignItems: "stretch",
|
|
37
|
+
alignContent: "start",
|
|
38
|
+
padding: 2,
|
|
39
|
+
sx: { cursor: "pointer", flex: "1 1 auto", overflowY: "auto", userSelect: "none" },
|
|
40
|
+
children: events.map((e, index) => /* @__PURE__ */ jsx(PixelEventDetails, { events, index, ...e }, `${e.event}-${index}`))
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
displayEvents && !events.length && /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "No Events" })
|
|
44
|
+
] })
|
|
45
|
+
}
|
|
46
|
+
) }) }) });
|
|
47
|
+
};
|
|
48
|
+
const PixelEventDetails = ({ event, fields, index, events }) => {
|
|
49
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
50
|
+
return /* @__PURE__ */ jsxs(FlexCol, { alignItems: "stretch", marginBottom: 0.5, onClick: () => setIsOpen(!isOpen), children: [
|
|
51
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: event }),
|
|
52
|
+
isOpen && /* @__PURE__ */ jsx(Typography, { marginBottom: 0.5, variant: "caption", children: JSON.stringify(fields, null, 2) }),
|
|
53
|
+
events[index + 1] && /* @__PURE__ */ jsx(Divider, {})
|
|
54
|
+
] });
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
PixelDebugger
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=PixelDebugger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebugger.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"],"mappings":"AAuCY,SAEI,KAFJ;AAvCZ,SAAS,OAAO,MAAM,SAAS,YAAY,gBAAgB;AAC3D,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,8BAA8B;AACvC,SAAS,cAAc;AACvB,SAAS,YAAY,gBAAgB;AAErC,SAAS,8BAA8B;AAGhC,MAAM,gBAA0B,MAAM;AAC3C,QAAM,EAAE,YAAY,IAAI,WAAW,sBAAsB;AAEzD,QAAM,QAAQ,SAAS;AACvB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAuB,CAAC,CAAC;AAErD,yBAAuB,CAAC,OAAe,WAAqC;AAC1E,cAAU,CAACA,YAAW,CAAC,EAAE,OAAO,OAAO,GAAG,GAAGA,OAAM,CAAC;AAAA,EACtD,CAAC;AAED,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,UACC,8BAAC,SAAI,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,SAAS,OAAO,IAAI,GAC9D,8BAAC,SAAM,cAAc,OAAO,QAAQ,OAAM,WAAU,IAAI,EAAE,OAAO,OAAO,GACtE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,IAAI;AAAA,QACF,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QACjB,WAAW;AAAA,QACX,OAAO;AAAA,MACT;AAAA,MACA,OAAO,MAAM,QAAQ,QAAQ;AAAA,MAE7B,+BAAC,WAAQ,YAAW,WAAU,IAAI,EAAE,UAAU,UAAU,WAAW,IAAI,GACrE;AAAA,4BAAC,WAAQ,YAAW,WAAU,IAAI,EAAE,MAAM,WAAW,GACnD,8BAAC,YAAS,SAAQ,QAAO,SAAS,MAAM,iBAAiB,CAAC,aAAa,GAAG,+BAE1E,GACF;AAAA,QACC,iBAAiB,CAAC,CAAC,OAAO,UACzB;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,cAAa;AAAA,YACb,SAAS;AAAA,YACT,IAAI,EAAE,QAAQ,WAAW,MAAM,YAAY,WAAW,QAAQ,YAAY,OAAO;AAAA,YAEhF,iBAAO,IAAI,CAAC,GAAG,UACd,oBAAC,qBAA8C,QAAgB,OAAe,GAAG,KAAzD,GAAG,EAAE,KAAK,IAAI,KAAK,EAAyC,CACrF;AAAA;AAAA,QACH;AAAA,QAED,iBAAiB,CAAC,OAAO,UAAU,oBAAC,cAAW,SAAQ,aAAY,uBAAS;AAAA,SAC/E;AAAA;AAAA,EACF,GACF,GACF,GACF;AAEJ;AAEA,MAAM,oBAAoF,CAAC,EAAE,OAAO,QAAQ,OAAO,OAAO,MAAM;AAC9H,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,SACE,qBAAC,WAAQ,YAAW,WAAU,cAAc,KAAK,SAAS,MAAM,UAAU,CAAC,MAAM,GAC/E;AAAA,wBAAC,cAAW,SAAQ,aAAa,iBAAM;AAAA,IACtC,UACC,oBAAC,cAAW,cAAc,KAAK,SAAQ,WACpC,eAAK,UAAU,QAAQ,MAAM,CAAC,GACjC;AAAA,IAED,OAAO,QAAQ,CAAC,KAAK,oBAAC,WAAQ;AAAA,KACjC;AAEJ;","names":["events"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 PixelDebugger_stories_exports = {};
|
|
20
|
+
__export(PixelDebugger_stories_exports, {
|
|
21
|
+
Default: () => Default,
|
|
22
|
+
default: () => PixelDebugger_stories_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(PixelDebugger_stories_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_pixel = require("@xylabs/pixel");
|
|
27
|
+
var import_react2 = require("react");
|
|
28
|
+
var import_index = require("./index");
|
|
29
|
+
var import_PixelDebuggerProvider = require("./PixelDebuggerProvider");
|
|
30
|
+
const StorybookEntry = {
|
|
31
|
+
argTypes: {},
|
|
32
|
+
component: import_index.PixelDebuggerToggle,
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
page: null
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
title: "pixel-debugger/PixelDebuggerToggle"
|
|
39
|
+
};
|
|
40
|
+
const Template = (args) => {
|
|
41
|
+
const [pixel, setPixel] = (0, import_react2.useState)();
|
|
42
|
+
(0, import_react2.useEffect)(() => {
|
|
43
|
+
import_pixel.XyPixel.selectApi(new import_pixel.PixelApi("local"));
|
|
44
|
+
setPixel(import_pixel.XyPixel.init("storybookPixel"));
|
|
45
|
+
}, []);
|
|
46
|
+
return pixel ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_PixelDebuggerProvider.PixelDebuggerProvider, { children: [
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_index.PixelDebuggerToggle, { ...args }),
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_index.PixelDebugger, {})
|
|
49
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
50
|
+
};
|
|
51
|
+
const Default = Template.bind({});
|
|
52
|
+
Default.args = {};
|
|
53
|
+
var PixelDebugger_stories_default = StorybookEntry;
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
Default
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=PixelDebugger.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebugger.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\nimport { PixelApi, XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nimport { PixelDebugger, PixelDebuggerToggle } from './index'\nimport { PixelDebuggerProvider } from './PixelDebuggerProvider'\n\nconst StorybookEntry = {\n argTypes: {},\n component: PixelDebuggerToggle,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'pixel-debugger/PixelDebuggerToggle',\n} as Meta<typeof PixelDebuggerToggle>\n\nconst Template: StoryFn<typeof PixelDebuggerToggle> = (args) => {\n const [pixel, setPixel] = useState<XyPixel>()\n useEffect(() => {\n XyPixel.selectApi(new PixelApi('local'))\n setPixel(XyPixel.init('storybookPixel'))\n }, [])\n return pixel ? (\n <PixelDebuggerProvider>\n <PixelDebuggerToggle {...args} />\n <PixelDebugger />\n </PixelDebuggerProvider>\n ) : (\n <></>\n )\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nexport { Default }\n\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBI;AAxBJ,mBAAkC;AAClC,IAAAA,gBAAoC;AAEpC,mBAAmD;AACnD,mCAAsC;AAEtC,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,WAAgD,CAAC,SAAS;AAC9D,QAAM,CAAC,OAAO,QAAQ,QAAI,wBAAkB;AAC5C,+BAAU,MAAM;AACd,yBAAQ,UAAU,IAAI,sBAAS,OAAO,CAAC;AACvC,aAAS,qBAAQ,KAAK,gBAAgB,CAAC;AAAA,EACzC,GAAG,CAAC,CAAC;AACL,SAAO,QACL,6CAAC,sDACC;AAAA,gDAAC,oCAAqB,GAAG,MAAM;AAAA,IAC/B,4CAAC,8BAAc;AAAA,KACjB,IAEA,2EAAE;AAEN;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAKhB,IAAO,gCAAQ;","names":["import_react"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PixelApi, XyPixel } from "@xylabs/pixel";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { PixelDebugger, PixelDebuggerToggle } from "./index";
|
|
5
|
+
import { PixelDebuggerProvider } from "./PixelDebuggerProvider";
|
|
6
|
+
const StorybookEntry = {
|
|
7
|
+
argTypes: {},
|
|
8
|
+
component: PixelDebuggerToggle,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
page: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
title: "pixel-debugger/PixelDebuggerToggle"
|
|
15
|
+
};
|
|
16
|
+
const Template = (args) => {
|
|
17
|
+
const [pixel, setPixel] = useState();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
XyPixel.selectApi(new PixelApi("local"));
|
|
20
|
+
setPixel(XyPixel.init("storybookPixel"));
|
|
21
|
+
}, []);
|
|
22
|
+
return pixel ? /* @__PURE__ */ jsxs(PixelDebuggerProvider, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(PixelDebuggerToggle, { ...args }),
|
|
24
|
+
/* @__PURE__ */ jsx(PixelDebugger, {})
|
|
25
|
+
] }) : /* @__PURE__ */ jsx(Fragment, {});
|
|
26
|
+
};
|
|
27
|
+
const Default = Template.bind({});
|
|
28
|
+
Default.args = {};
|
|
29
|
+
var PixelDebugger_stories_default = StorybookEntry;
|
|
30
|
+
export {
|
|
31
|
+
Default,
|
|
32
|
+
PixelDebugger_stories_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=PixelDebugger.stories.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebugger.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\nimport { PixelApi, XyPixel } from '@xylabs/pixel'\nimport { useEffect, useState } from 'react'\n\nimport { PixelDebugger, PixelDebuggerToggle } from './index'\nimport { PixelDebuggerProvider } from './PixelDebuggerProvider'\n\nconst StorybookEntry = {\n argTypes: {},\n component: PixelDebuggerToggle,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'pixel-debugger/PixelDebuggerToggle',\n} as Meta<typeof PixelDebuggerToggle>\n\nconst Template: StoryFn<typeof PixelDebuggerToggle> = (args) => {\n const [pixel, setPixel] = useState<XyPixel>()\n useEffect(() => {\n XyPixel.selectApi(new PixelApi('local'))\n setPixel(XyPixel.init('storybookPixel'))\n }, [])\n return pixel ? (\n <PixelDebuggerProvider>\n <PixelDebuggerToggle {...args} />\n <PixelDebugger />\n </PixelDebuggerProvider>\n ) : (\n <></>\n )\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nexport { Default }\n\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":"AAyBI,SAKA,UAJE,KADF;AAxBJ,SAAS,UAAU,eAAe;AAClC,SAAS,WAAW,gBAAgB;AAEpC,SAAS,eAAe,2BAA2B;AACnD,SAAS,6BAA6B;AAEtC,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,WAAgD,CAAC,SAAS;AAC9D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAkB;AAC5C,YAAU,MAAM;AACd,YAAQ,UAAU,IAAI,SAAS,OAAO,CAAC;AACvC,aAAS,QAAQ,KAAK,gBAAgB,CAAC;AAAA,EACzC,GAAG,CAAC,CAAC;AACL,SAAO,QACL,qBAAC,yBACC;AAAA,wBAAC,uBAAqB,GAAG,MAAM;AAAA,IAC/B,oBAAC,iBAAc;AAAA,KACjB,IAEA,gCAAE;AAEN;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAKhB,IAAO,gCAAQ;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 PixelDebuggerProvider_exports = {};
|
|
20
|
+
__export(PixelDebuggerProvider_exports, {
|
|
21
|
+
PixelDebuggerProvider: () => PixelDebuggerProvider
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(PixelDebuggerProvider_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_react_pixel = require("@xylabs/react-pixel");
|
|
26
|
+
var import_react_shared = require("@xylabs/react-shared");
|
|
27
|
+
const PixelDebuggerProvider = ({ children }) => {
|
|
28
|
+
const [isDebugging, setIsDebugging] = (0, import_react_shared.useLocalStorage)("isDebuggingPixel", false);
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_pixel.DebugUserEventsContext.Provider, { value: { isDebugging, setIsDebugging }, children });
|
|
30
|
+
};
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
PixelDebuggerProvider
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=PixelDebuggerProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebuggerProvider.tsx"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKS;AALT,yBAAuC;AACvC,0BAA8C;AAEvC,MAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,QAAM,CAAC,aAAa,cAAc,QAAI,qCAAyB,oBAAoB,KAAK;AACxF,SAAO,4CAAC,0CAAuB,UAAvB,EAAgC,OAAO,EAAE,aAAa,eAAe,GAAI,UAAS;AAC5F;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DebugUserEventsContext } from "@xylabs/react-pixel";
|
|
3
|
+
import { useLocalStorage } from "@xylabs/react-shared";
|
|
4
|
+
const PixelDebuggerProvider = ({ children }) => {
|
|
5
|
+
const [isDebugging, setIsDebugging] = useLocalStorage("isDebuggingPixel", false);
|
|
6
|
+
return /* @__PURE__ */ jsx(DebugUserEventsContext.Provider, { value: { isDebugging, setIsDebugging }, children });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
PixelDebuggerProvider
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=PixelDebuggerProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebuggerProvider.tsx"],"sourcesContent":["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"],"mappings":"AAKS;AALT,SAAS,8BAA8B;AACvC,SAAS,uBAAqC;AAEvC,MAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,QAAM,CAAC,aAAa,cAAc,IAAI,gBAAyB,oBAAoB,KAAK;AACxF,SAAO,oBAAC,uBAAuB,UAAvB,EAAgC,OAAO,EAAE,aAAa,eAAe,GAAI,UAAS;AAC5F;","names":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 PixelDebuggerToggle_exports = {};
|
|
20
|
+
__export(PixelDebuggerToggle_exports, {
|
|
21
|
+
PixelDebuggerToggle: () => PixelDebuggerToggle
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(PixelDebuggerToggle_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_material = require("@mui/material");
|
|
26
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
27
|
+
var import_react_pixel = require("@xylabs/react-pixel");
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
const PixelDebuggerToggle = ({ ...props }) => {
|
|
30
|
+
const { setIsDebugging, isDebugging } = (0, import_react.useContext)(import_react_pixel.DebugUserEventsContext);
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexRow, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.FormControl, { children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.FormLabel, { children: "Enable Debugger" }),
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Switch, { checked: isDebugging, onClick: () => setIsDebugging(!isDebugging) })
|
|
34
|
+
] }) });
|
|
35
|
+
};
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
PixelDebuggerToggle
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=PixelDebuggerToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebuggerToggle.tsx"],"sourcesContent":["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;AAUM;AAVN,sBAA+C;AAC/C,2BAAsC;AACtC,yBAAuC;AACvC,mBAA2B;AAEpB,MAAM,sBAA8C,CAAC,EAAE,GAAG,MAAM,MAAM;AAC3E,QAAM,EAAE,gBAAgB,YAAY,QAAI,yBAAW,yCAAsB;AAEzE,SACE,4CAAC,gCAAS,GAAG,OACX,uDAAC,+BACC;AAAA,gDAAC,6BAAU,6BAAe;AAAA,IAC1B,4CAAC,0BAAO,SAAS,aAAa,SAAS,MAAM,eAAe,CAAC,WAAW,GAAG;AAAA,KAC7E,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl, FormLabel, Switch } from "@mui/material";
|
|
3
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { DebugUserEventsContext } from "@xylabs/react-pixel";
|
|
5
|
+
import { useContext } from "react";
|
|
6
|
+
const PixelDebuggerToggle = ({ ...props }) => {
|
|
7
|
+
const { setIsDebugging, isDebugging } = useContext(DebugUserEventsContext);
|
|
8
|
+
return /* @__PURE__ */ jsx(FlexRow, { ...props, children: /* @__PURE__ */ jsxs(FormControl, { children: [
|
|
9
|
+
/* @__PURE__ */ jsx(FormLabel, { children: "Enable Debugger" }),
|
|
10
|
+
/* @__PURE__ */ jsx(Switch, { checked: isDebugging, onClick: () => setIsDebugging(!isDebugging) })
|
|
11
|
+
] }) });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
PixelDebuggerToggle
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=PixelDebuggerToggle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/PixelDebuggerToggle.tsx"],"sourcesContent":["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":"AAUM,SACE,KADF;AAVN,SAAS,aAAa,WAAW,cAAc;AAC/C,SAAuB,eAAe;AACtC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB;AAEpB,MAAM,sBAA8C,CAAC,EAAE,GAAG,MAAM,MAAM;AAC3E,QAAM,EAAE,gBAAgB,YAAY,IAAI,WAAW,sBAAsB;AAEzE,SACE,oBAAC,WAAS,GAAG,OACX,+BAAC,eACC;AAAA,wBAAC,aAAU,6BAAe;AAAA,IAC1B,oBAAC,UAAO,SAAS,aAAa,SAAS,MAAM,eAAe,CAAC,WAAW,GAAG;AAAA,KAC7E,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
13
|
+
};
|
|
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
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './PixelDebugger'\nexport * from './PixelDebuggerProvider'\nexport * from './PixelDebuggerToggle'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PixelEvent.d.ts","sourceRoot":"","sources":["../../src/PixelEvent.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=PixelEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PixelDebugger.d.ts","sourceRoot":"","sources":["../../../src/components/PixelDebugger.tsx"],"names":[],"mappings":";AAUA,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAsDjC,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
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 } from "react";
|
|
8
|
+
import { usePixelAltSendHandler } from "../hooks";
|
|
9
|
+
const PixelDebugger = () => {
|
|
10
|
+
const { isDebugging } = useContext(DebugUserEventsContext);
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
const [displayEvents, setDisplayEvents] = useState(false);
|
|
13
|
+
const [events, setEvents] = useState([]);
|
|
14
|
+
usePixelAltSendHandler((event, fields) => {
|
|
15
|
+
setEvents((events2) => [{ event, fields }, ...events2]);
|
|
16
|
+
});
|
|
17
|
+
if (!isDebugging) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
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(
|
|
21
|
+
Card,
|
|
22
|
+
{
|
|
23
|
+
variant: "outlined",
|
|
24
|
+
sx: {
|
|
25
|
+
backdropFilter: "blur(16px) saturate(180%)",
|
|
26
|
+
backgroundColor: "rgba(18, 18, 18, .70)",
|
|
27
|
+
overflowY: "auto",
|
|
28
|
+
width: "100%"
|
|
29
|
+
},
|
|
30
|
+
color: theme.palette.primary.main,
|
|
31
|
+
children: /* @__PURE__ */ jsxs(FlexCol, { alignItems: "stretch", sx: { flexFlow: "column", maxHeight: 400 }, children: [
|
|
32
|
+
/* @__PURE__ */ jsx(FlexCol, { alignItems: "stretch", sx: { flex: "0 1 auto" }, children: /* @__PURE__ */ jsx(ButtonEx, { variant: "text", onClick: () => setDisplayEvents(!displayEvents), children: "XY Pixel Debugger" }) }),
|
|
33
|
+
displayEvents && !!events.length && /* @__PURE__ */ jsx(
|
|
34
|
+
FlexCol,
|
|
35
|
+
{
|
|
36
|
+
alignItems: "stretch",
|
|
37
|
+
alignContent: "start",
|
|
38
|
+
padding: 2,
|
|
39
|
+
sx: { cursor: "pointer", flex: "1 1 auto", overflowY: "auto", userSelect: "none" },
|
|
40
|
+
children: events.map((e, index) => /* @__PURE__ */ jsx(PixelEventDetails, { events, index, ...e }, `${e.event}-${index}`))
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
displayEvents && !events.length && /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "No Events" })
|
|
44
|
+
] })
|
|
45
|
+
}
|
|
46
|
+
) }) }) });
|
|
47
|
+
};
|
|
48
|
+
const PixelEventDetails = ({ event, fields, index, events }) => {
|
|
49
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
50
|
+
return /* @__PURE__ */ jsxs(FlexCol, { alignItems: "stretch", marginBottom: 0.5, onClick: () => setIsOpen(!isOpen), children: [
|
|
51
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: event }),
|
|
52
|
+
isOpen && /* @__PURE__ */ jsx(Typography, { marginBottom: 0.5, variant: "caption", children: JSON.stringify(fields, null, 2) }),
|
|
53
|
+
events[index + 1] && /* @__PURE__ */ jsx(Divider, {})
|
|
54
|
+
] });
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
PixelDebugger
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=PixelDebugger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/PixelDebugger.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"],"mappings":"AAuCY,SAEI,KAFJ;AAvCZ,SAAS,OAAO,MAAM,SAAS,YAAY,gBAAgB;AAC3D,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,8BAA8B;AACvC,SAAS,cAAc;AACvB,SAAS,YAAY,gBAAgB;AAErC,SAAS,8BAA8B;AAGhC,MAAM,gBAA0B,MAAM;AAC3C,QAAM,EAAE,YAAY,IAAI,WAAW,sBAAsB;AAEzD,QAAM,QAAQ,SAAS;AACvB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAuB,CAAC,CAAC;AAErD,yBAAuB,CAAC,OAAe,WAAqC;AAC1E,cAAU,CAACA,YAAW,CAAC,EAAE,OAAO,OAAO,GAAG,GAAGA,OAAM,CAAC;AAAA,EACtD,CAAC;AAED,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,UACC,8BAAC,SAAI,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,SAAS,OAAO,IAAI,GAC9D,8BAAC,SAAM,cAAc,OAAO,QAAQ,OAAM,WAAU,IAAI,EAAE,OAAO,OAAO,GACtE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,IAAI;AAAA,QACF,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QACjB,WAAW;AAAA,QACX,OAAO;AAAA,MACT;AAAA,MACA,OAAO,MAAM,QAAQ,QAAQ;AAAA,MAE7B,+BAAC,WAAQ,YAAW,WAAU,IAAI,EAAE,UAAU,UAAU,WAAW,IAAI,GACrE;AAAA,4BAAC,WAAQ,YAAW,WAAU,IAAI,EAAE,MAAM,WAAW,GACnD,8BAAC,YAAS,SAAQ,QAAO,SAAS,MAAM,iBAAiB,CAAC,aAAa,GAAG,+BAE1E,GACF;AAAA,QACC,iBAAiB,CAAC,CAAC,OAAO,UACzB;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,cAAa;AAAA,YACb,SAAS;AAAA,YACT,IAAI,EAAE,QAAQ,WAAW,MAAM,YAAY,WAAW,QAAQ,YAAY,OAAO;AAAA,YAEhF,iBAAO,IAAI,CAAC,GAAG,UACd,oBAAC,qBAA8C,QAAgB,OAAe,GAAG,KAAzD,GAAG,EAAE,KAAK,IAAI,KAAK,EAAyC,CACrF;AAAA;AAAA,QACH;AAAA,QAED,iBAAiB,CAAC,OAAO,UAAU,oBAAC,cAAW,SAAQ,aAAY,uBAAS;AAAA,SAC/E;AAAA;AAAA,EACF,GACF,GACF,GACF;AAEJ;AAEA,MAAM,oBAAoF,CAAC,EAAE,OAAO,QAAQ,OAAO,OAAO,MAAM;AAC9H,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,SACE,qBAAC,WAAQ,YAAW,WAAU,cAAc,KAAK,SAAS,MAAM,UAAU,CAAC,MAAM,GAC/E;AAAA,wBAAC,cAAW,SAAQ,aAAa,iBAAM;AAAA,IACtC,UACC,oBAAC,cAAW,cAAc,KAAK,SAAQ,WACpC,eAAK,UAAU,QAAQ,MAAM,CAAC,GACjC;AAAA,IAED,OAAO,QAAQ,CAAC,KAAK,oBAAC,WAAQ;AAAA,KACjC;AAEJ;","names":["events"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const StorybookEntry: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@xylabs/react-flexbox").BusyBoxProps>;
|
|
2
|
+
declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("@xylabs/react-flexbox").BusyBoxProps>;
|
|
3
|
+
export { Default };
|
|
4
|
+
export default StorybookEntry;
|
|
5
|
+
//# sourceMappingURL=PixelDebugger.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PixelDebugger.stories.d.ts","sourceRoot":"","sources":["../../../src/components/PixelDebugger.stories.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,cAAc,iJASiB,CAAA;AAkBrC,QAAA,MAAM,OAAO,6IAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAGlB,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PixelApi, XyPixel } from "@xylabs/pixel";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { PixelDebugger, PixelDebuggerToggle } from "./index";
|
|
5
|
+
import { PixelDebuggerProvider } from "./PixelDebuggerProvider";
|
|
6
|
+
const StorybookEntry = {
|
|
7
|
+
argTypes: {},
|
|
8
|
+
component: PixelDebuggerToggle,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
page: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
title: "pixel-debugger/PixelDebuggerToggle"
|
|
15
|
+
};
|
|
16
|
+
const Template = (args) => {
|
|
17
|
+
const [pixel, setPixel] = useState();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
XyPixel.selectApi(new PixelApi("local"));
|
|
20
|
+
setPixel(XyPixel.init("storybookPixel"));
|
|
21
|
+
}, []);
|
|
22
|
+
return pixel ? /* @__PURE__ */ jsxs(PixelDebuggerProvider, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(PixelDebuggerToggle, { ...args }),
|
|
24
|
+
/* @__PURE__ */ jsx(PixelDebugger, {})
|
|
25
|
+
] }) : /* @__PURE__ */ jsx(Fragment, {});
|
|
26
|
+
};
|
|
27
|
+
const Default = Template.bind({});
|
|
28
|
+
Default.args = {};
|
|
29
|
+
var PixelDebugger_stories_default = StorybookEntry;
|
|
30
|
+
export {
|
|
31
|
+
Default,
|
|
32
|
+
PixelDebugger_stories_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=PixelDebugger.stories.js.map
|