eddev 2.3.21 → 2.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/css/devtools.css +45 -5
  2. package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts +1 -1
  3. package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts.map +1 -1
  4. package/dist/app/lib/devtools/components/BreakpointIndicator.js +43 -18
  5. package/dist/app/lib/devtools/components/DevMenu.d.ts.map +1 -1
  6. package/dist/app/lib/devtools/components/DevMenu.js +9 -11
  7. package/dist/app/lib/devtools/components/DevUI.d.ts.map +1 -1
  8. package/dist/app/lib/devtools/components/DevUI.js +12 -4
  9. package/dist/app/lib/devtools/components/panels/AppDataPanel.d.ts.map +1 -1
  10. package/dist/app/lib/devtools/components/panels/AppDataPanel.js +1 -3
  11. package/dist/app/lib/devtools/components/panels/QueriesPanel.d.ts.map +1 -1
  12. package/dist/app/lib/devtools/components/panels/QueriesPanel.js +1 -2
  13. package/dist/app/lib/devtools/components/panels/RoutePanel.d.ts.map +1 -1
  14. package/dist/app/lib/devtools/components/panels/RoutePanel.js +4 -4
  15. package/dist/app/lib/devtools/components/panels/StructurePanel.d.ts.map +1 -1
  16. package/dist/app/lib/devtools/components/panels/StructurePanel.js +2 -3
  17. package/dist/app/lib/devtools/components/panels/index.d.ts +1 -0
  18. package/dist/app/lib/devtools/components/panels/index.d.ts.map +1 -1
  19. package/dist/app/lib/devtools/components/panels/index.js +12 -8
  20. package/dist/app/lib/devtools/components/ui/Button.d.ts +3 -2
  21. package/dist/app/lib/devtools/components/ui/Button.d.ts.map +1 -1
  22. package/dist/app/lib/devtools/components/ui/Button.js +22 -2
  23. package/dist/app/lib/devtools/components/ui/JSONInspector.js +1 -1
  24. package/dist/app/lib/devtools/components/ui/Panel.d.ts +5 -2
  25. package/dist/app/lib/devtools/components/ui/Panel.d.ts.map +1 -1
  26. package/dist/app/lib/devtools/components/ui/Panel.js +9 -2
  27. package/dist/app/lib/devtools/components/ui/TabBar.js +1 -1
  28. package/dist/app/lib/devtools/icons.d.ts +3 -0
  29. package/dist/app/lib/devtools/icons.d.ts.map +1 -1
  30. package/dist/app/lib/devtools/icons.js +3 -0
  31. package/dist/app/lib/devtools/lib/edit-link.d.ts +2 -0
  32. package/dist/app/lib/devtools/lib/edit-link.d.ts.map +1 -0
  33. package/dist/app/lib/devtools/lib/edit-link.js +4 -0
  34. package/dist/app/lib/devtools/tailwind.config.d.ts +1 -0
  35. package/dist/app/lib/devtools/tailwind.config.d.ts.map +1 -1
  36. package/dist/app/lib/devtools/tailwind.config.js +2 -1
  37. package/dist/node/cli/version.d.ts +1 -1
  38. package/dist/node/cli/version.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/app/lib/devtools/components/GridIndicator.d.ts +0 -2
  41. package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +0 -1
  42. package/dist/app/lib/devtools/components/GridIndicator.js +0 -30
package/css/devtools.css CHANGED
@@ -4,17 +4,24 @@
4
4
 
5
5
  @config "../dist/app/lib/devtools/tailwind.config.js";
6
6
 
7
- .eddev-ui {
7
+ #eddev-ui {
8
8
  @apply text-ui font-mono;
9
9
  }
10
10
 
11
11
  @layer components {
12
12
  .btn {
13
- .eddev-ui & {
13
+ #eddev-ui & {
14
14
  @apply flex items-center justify-center text-ui font-mono h-button rounded-full gap-1.5;
15
15
 
16
16
  &[data-variant="button"] {
17
17
  @apply bg-black text-white px-2;
18
+ &:has(svg:first-child) {
19
+ @apply pl-1.5;
20
+ }
21
+
22
+ &:hover {
23
+ @apply bg-neutral-800;
24
+ }
18
25
  }
19
26
 
20
27
  &[data-variant="subtle"] {
@@ -30,20 +37,40 @@
30
37
  }
31
38
 
32
39
  &[data-shape="icon"] {
33
- @apply w-button p-0;
40
+ @apply w-button !p-0;
41
+
42
+ &:hover {
43
+ @apply bg-neutral-800;
44
+ }
34
45
  }
35
46
 
36
47
  svg {
37
- @apply size-[1.2em];
48
+ @apply size-[1.2em] flex-none;
38
49
  fill: currentColor;
39
50
  }
40
51
  }
41
52
  }
42
53
  }
43
54
 
44
- .eddev-ui {
55
+ #eddev-ui {
45
56
  letter-spacing: -0.02em;
46
57
 
58
+ .btn-group {
59
+ display: inline-flex;
60
+
61
+ > :not(:first-child) {
62
+ border-top-left-radius: 0;
63
+ border-bottom-left-radius: 0;
64
+ }
65
+ > :not(:last-child) {
66
+ border-top-right-radius: 0;
67
+ border-bottom-right-radius: 0;
68
+ }
69
+ > :not(:first-child) {
70
+ border-left: 1px solid rgba(255, 255, 255, 0.2);
71
+ }
72
+ }
73
+
47
74
  .json-inspector,
48
75
  .json-inspector__selection {
49
76
  font:
@@ -152,4 +179,17 @@
152
179
  background-color: transparent !important;
153
180
  }
154
181
  }
182
+
183
+ kbd {
184
+ @apply border-neutral-600/50 border px-0.5 rounded-sm;
185
+ }
186
+
187
+ .eddev-no-scrollbars {
188
+ scrollbar-width: none; /* Firefox */
189
+ -ms-overflow-style: none; /* IE 10+ */
190
+
191
+ &::-webkit-scrollbar {
192
+ display: none; /* Chrome, Safari, Opera */
193
+ }
194
+ }
155
195
  }
@@ -1,2 +1,2 @@
1
- export declare function BreakpointIndicator(): import("react").JSX.Element;
1
+ export declare function BreakpointIndicator(): import("react").JSX.Element | null;
2
2
  //# sourceMappingURL=BreakpointIndicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BreakpointIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/BreakpointIndicator.tsx"],"names":[],"mappings":"AAyBA,wBAAgB,mBAAmB,gCAuGlC"}
1
+ {"version":3,"file":"BreakpointIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/BreakpointIndicator.tsx"],"names":[],"mappings":"AA4BA,wBAAgB,mBAAmB,uCAmIlC"}
@@ -1,7 +1,10 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useMemo, useRef, useState } from "react";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from "react";
3
+ import { createPortal } from "react-dom";
3
4
  import { usePersistState } from "../hooks/usePersistState.js";
4
5
  import { useTailwindConfig } from "../hooks/useTailwind.js";
6
+ import { gridOff, gridOn } from "../icons.js";
7
+ import { Button } from "./ui/Button.js";
5
8
  function parseBreakpointMin(breakpoint) {
6
9
  return parseInt(breakpoint);
7
10
  }
@@ -21,7 +24,7 @@ function getColors(index) {
21
24
  };
22
25
  }
23
26
  export function BreakpointIndicator() {
24
- const ref = useRef(null);
27
+ const [gridEnabled, setGridEnabled] = usePersistState("gridOverlayEnabled", false);
25
28
  const tw = useTailwindConfig();
26
29
  const [activeSize, setActiveSize] = useState(-1);
27
30
  const [width, setWidth] = useState(window.innerWidth);
@@ -60,22 +63,44 @@ export function BreakpointIndicator() {
60
63
  window.addEventListener("resize", update);
61
64
  return () => window.removeEventListener("resize", update);
62
65
  }, [screens, !!tw]);
66
+ useEffect(() => {
67
+ const handleKeyDown = (e) => {
68
+ if (e.key === "g" && e.ctrlKey) {
69
+ setGridEnabled((e) => !e);
70
+ }
71
+ };
72
+ window.addEventListener("keydown", handleKeyDown);
73
+ return () => {
74
+ window.removeEventListener("keydown", handleKeyDown);
75
+ };
76
+ }, []);
63
77
  const maxSize = screens[screens.length - 1]?.min;
64
78
  const screen = screens[activeSize];
65
79
  const globalProgress = width / maxSize;
66
- return (_jsx("div", { ref: ref, "data-breakpoint": true, onClick: () => setExpanded(!expanded), children: !!screens && !!screen && (_jsx(_Fragment, { children: expanded ? (_jsx("div", { className: "btn w-[400px] bg-black px-2", children: _jsxs("div", { className: "relative w-full h-full cursor-pointer", children: [_jsxs("div", { className: "absolute bottom-[-3px] -translate-x-1/2 -translate-y-1/2 leading-none text-[8px] text-white", style: { left: `calc(min(${globalProgress},1) * 100%)` }, children: ["\u23F6 ", _jsxs("span", { className: globalProgress < 0.85 ? `absolute left-2` : `absolute right-2`, children: [width, "px"] })] }), screens.map((screen, i) => {
67
- const colors = getColors(i);
68
- const active = i === activeSize;
69
- const last = i === screens.length - 1;
70
- return (_jsxs("div", { className: "absolute flex-1 flex flex-col data-[disabled]:opacity-60 transition-opacity", "data-disabled": active ? undefined : "", style: last
71
- ? {
72
- right: 0,
73
- }
74
- : {
75
- left: `${(screen.min / maxSize) * 100}%`,
76
- width: `${(((screen.max ?? maxSize) - screen.min) / maxSize) * 100}%`,
77
- }, children: [_jsx("span", { className: "text-[8px] text-neutral-300 leading-normal", style: { color: active ? colors.backgroundColor : undefined }, children: screen.name }), !last && _jsx("span", { className: "h-[1px]", style: colors })] }, screen.name));
78
- })] }) })) : (
79
- // Condensed
80
- _jsx("div", { className: "btn px-3 cursor-pointer", style: getColors(activeSize), children: screen.name })) })) }));
80
+ if (!screens || !screen)
81
+ return null;
82
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "btn-group", children: [_jsx(Button, { className: "btn", shape: "icon", variant: "button", tooltip: _jsxs(_Fragment, { children: ["Toggle grid ", _jsx("kbd", { children: "ctrl+g" })] }), onClick: (e) => {
83
+ setGridEnabled(!gridEnabled);
84
+ }, children: _jsx("span", { className: "ml-0.5", children: gridEnabled ? gridOn : gridOff }) }), expanded ? (_jsx("div", { className: "btn w-[400px] bg-black px-2", onClick: () => setExpanded(!expanded), children: _jsxs("div", { className: "relative w-full h-full cursor-pointer", children: [_jsxs("div", { className: "absolute bottom-[-3px] -translate-x-1/2 -translate-y-1/2 leading-none text-[8px] text-white", style: { left: `calc(min(${globalProgress},1) * 100%)` }, children: ["\u23F6 ", _jsxs("span", { className: globalProgress < 0.85 ? `absolute left-2` : `absolute right-2`, children: [width, "px"] })] }), screens.map((screen, i) => {
85
+ const colors = getColors(i);
86
+ const active = i === activeSize;
87
+ const last = i === screens.length - 1;
88
+ return (_jsxs("div", { className: "absolute flex-1 flex flex-col data-[disabled]:opacity-60 transition-opacity", "data-disabled": active ? undefined : "", style: last
89
+ ? {
90
+ right: 0,
91
+ }
92
+ : {
93
+ left: `${(screen.min / maxSize) * 100}%`,
94
+ width: `${(((screen.max ?? maxSize) - screen.min) / maxSize) * 100}%`,
95
+ }, children: [_jsx("span", { className: "text-[8px] text-neutral-300 leading-normal", style: { color: active ? colors.backgroundColor : undefined }, children: screen.name }), !last && _jsx("span", { className: "h-[1px]", style: colors })] }, screen.name));
96
+ })] }) })) : (
97
+ // Condensed
98
+ _jsx("div", { className: "btn px-3 cursor-pointer", style: getColors(activeSize), onClick: () => setExpanded(!expanded), children: screen.name }))] }), gridEnabled && _jsx(GridOverlay, {})] }));
99
+ }
100
+ function GridOverlay() {
101
+ const cols = [];
102
+ for (let i = 0; i < 12; i++) {
103
+ cols.push(_jsx("div", { style: { height: "100%", backgroundColor: "rgba(255,0,0,0.1)" } }, i));
104
+ }
105
+ return createPortal(_jsx("div", { style: { zIndex: 10000000, position: "fixed", inset: 0, pointerEvents: "none" }, children: _jsx("div", { className: "grid-auto", style: { height: "100%" }, children: cols }) }), document.body);
81
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DevMenu.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/DevMenu.tsx"],"names":[],"mappings":"AAKA,wBAAgB,OAAO,gCAoCtB"}
1
+ {"version":3,"file":"DevMenu.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/DevMenu.tsx"],"names":[],"mappings":"AAMA,wBAAgB,OAAO,gCAsCtB"}
@@ -3,17 +3,15 @@ import { usePersistState } from "../hooks/usePersistState.js";
3
3
  import { bolt, close } from "../icons.js";
4
4
  import { DEV_TOOLS_PANELS } from "./panels/index.js";
5
5
  import { Button } from "./ui/Button.js";
6
+ import { Panel } from "./ui/Panel.js";
6
7
  export function DevMenu() {
7
8
  const [expanded, setExpanded] = usePersistState("menuOpen", false);
8
- const [currentTab, setCurrentTab] = usePersistState("currentTab", "none");
9
- const tab = DEV_TOOLS_PANELS[currentTab];
10
- return (_jsxs(_Fragment, { children: [_jsx(Button, { shape: "icon", onClick: () => setExpanded(!expanded), children: expanded ? close : bolt }), expanded &&
11
- Object.entries(DEV_TOOLS_PANELS).map(([key, info]) => (_jsxs(Button, { variant: "tab", active: currentTab === key, onClick: () => {
12
- if (currentTab === key) {
13
- setCurrentTab("none");
14
- }
15
- else {
16
- setCurrentTab(key);
17
- }
18
- }, children: [info.icon, info.label] }, key))), expanded && tab && (_jsx("div", { className: "max-w-[100vw] absolute left-0 bottom-[calc(100%+10px)]", children: _jsx(tab.component, {}) }))] }));
9
+ const [currentTab, setCurrentTab] = usePersistState("currentTab", "appData");
10
+ const tabName = currentTab === "none" ? "appData" : currentTab;
11
+ const tab = DEV_TOOLS_PANELS[tabName];
12
+ const tabNames = Object.keys(DEV_TOOLS_PANELS);
13
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { shape: "icon", title: expanded ? "Close Dev UI" : "Open Dev UI", onClick: () => setExpanded(!expanded), children: expanded ? close : bolt }), expanded && (_jsx("div", { className: "max-w-[calc(100vw-16px)] absolute left-0 bottom-[calc(100%+10px)]", children: _jsx(Panel, { id: "devtools", padded: tab.padded, header: _jsx("div", { className: "flex whitespace-nowrap flex-none gap-2 -ml-2", children: tabNames.map((name) => {
14
+ const info = DEV_TOOLS_PANELS[name];
15
+ return (_jsxs(Button, { variant: "tab", active: tabName === name, onClick: () => setCurrentTab(name), children: [info.icon, info.label] }, name));
16
+ }) }), children: _jsx(tab.component, {}) }) }))] }));
19
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DevUI.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/DevUI.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,iCAAiC,CAAA;AAQxC,MAAM,CAAC,OAAO,UAAU,KAAK,gCAgB5B;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;IACjE,KAAK,EAAE,KAAK,CAElB;WAEa,wBAAwB,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK;IAKlD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAIpD,MAAM;CAwBd"}
1
+ {"version":3,"file":"DevUI.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/DevUI.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,iCAAiC,CAAA;AAUxC,MAAM,CAAC,OAAO,UAAU,KAAK,gCAgB5B;AAuBD,UAAU,KAAK;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;IACjE,KAAK,EAAE,KAAK,CAElB;WAEa,wBAAwB,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK;IAKlD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAIpD,MAAM;CAwBd"}
@@ -1,14 +1,22 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Component } from "react";
3
3
  import "../../../../../css/devtools.css";
4
+ import { useRouterState } from "../../routing/index.js";
5
+ import { usePersistState } from "../hooks/usePersistState.js";
6
+ import { pencil } from "../icons.js";
7
+ import { normalizeEditLink } from "../lib/edit-link.js";
4
8
  import { BreakpointIndicator } from "./BreakpointIndicator.js";
5
9
  import { DevMenu } from "./DevMenu.js";
6
- import { GridIndicator } from "./GridIndicator.js";
7
- import { Panel } from "./ui/Panel.js";
8
10
  import { Button } from "./ui/Button.js";
9
- import { usePersistState } from "../hooks/usePersistState.js";
11
+ import { Panel } from "./ui/Panel.js";
10
12
  export default function DevUI() {
11
- return (_jsx("div", { className: "eddev-ui", children: _jsx("div", { className: "fixed left-2 bottom-2 right-2 z-[999999999999999] pointer-events-none flex justify-start", children: _jsx("div", { className: "flex gap-2 items-center pointer-events-auto", children: _jsxs(ErrorBoundary, { children: [_jsx(DevMenu, {}), _jsx("div", { children: _jsx(BreakpointIndicator, {}) }), _jsx(GridIndicator, {})] }) }) }) }));
13
+ return (_jsx("div", { id: "eddev-ui", children: _jsx("div", { className: "fixed left-2 bottom-2 right-2 z-[999999999999999] pointer-events-none flex justify-start", children: _jsx("div", { className: "flex gap-2 items-center pointer-events-auto", children: _jsxs(ErrorBoundary, { children: [_jsxs("div", { className: "btn-group", children: [_jsx(DevMenu, {}), _jsx(RouteEditButton, {})] }), _jsx(BreakpointIndicator, {})] }) }) }) }));
14
+ }
15
+ function RouteEditButton() {
16
+ const editLink = useRouterState((state) => state.activeRoute.meta.admin?.editLink);
17
+ if (!editLink)
18
+ return null;
19
+ return (_jsxs(Button, { className: "btn", "data-shape": "default", "data-variant": "button", href: normalizeEditLink(editLink), target: "_blank", rel: "noreferrer", title: "Edit in WP Admin", children: [pencil, "Edit"] }));
12
20
  }
13
21
  export class ErrorBoundary extends Component {
14
22
  state = {
@@ -1 +1 @@
1
- {"version":3,"file":"AppDataPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/AppDataPanel.tsx"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,gCAM3B;AAED,wBAAgB,UAAU,gCAqBzB"}
1
+ {"version":3,"file":"AppDataPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/AppDataPanel.tsx"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,gCAE3B;AAED,wBAAgB,UAAU,gCAqBzB"}
@@ -1,12 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useAppData, useAppDataQueryMonitor } from "../../../hooks/useAppData.js";
3
3
  import { JSONInspector } from "../ui/JSONInspector.js";
4
- import { Panel } from "../ui/Panel.js";
5
4
  import { QueryMonitorDisplay } from "../ui/QueryMonitorDisplay.js";
6
- // import { JsonInspector } from "@rexxars/react-json-inspector"
7
5
  //
8
6
  export function AppDataPanel() {
9
- return (_jsx(Panel, { title: "App", padded: true, id: "app", children: _jsx(AppDetails, {}) }));
7
+ return _jsx(AppDetails, {});
10
8
  }
11
9
  export function AppDetails() {
12
10
  const appData = useAppData();
@@ -1 +1 @@
1
- {"version":3,"file":"QueriesPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/QueriesPanel.tsx"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,gCAM3B"}
1
+ {"version":3,"file":"QueriesPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/QueriesPanel.tsx"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,gCAE3B"}
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Panel } from "../ui/Panel.js";
3
2
  export function QueriesPanel() {
4
- return (_jsx(Panel, { title: "Queries", padded: true, id: "queries", children: "WIP" }));
3
+ return _jsx("div", { children: "WIP" });
5
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RoutePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/RoutePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA8C,MAAM,2BAA2B,CAAA;AAmKlG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE,+BAwB5D;AAED,wBAAgB,UAAU,gCAuDzB"}
1
+ {"version":3,"file":"RoutePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/RoutePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA8C,MAAM,2BAA2B,CAAA;AAmKlG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE,+BAwB5D;AAED,wBAAgB,UAAU,gCAwDzB"}
@@ -1,14 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useRouter, useRouterEvents, useRouterState } from "../../../routing/index.js";
3
- import { Panel } from "../ui/Panel.js";
3
+ import { PanelWidgets } from "../ui/Panel.js";
4
4
  import { Fragment, useEffect } from "react";
5
- import { withoutHost } from "ufo";
6
5
  import { terminal, undo } from "../../icons.js";
7
6
  import { Button } from "../ui/Button.js";
8
7
  import { Chip, ChipGroup } from "../ui/Chip.js";
9
8
  import { JSONInspector } from "../ui/JSONInspector.js";
10
9
  import { QueryMonitorDisplay } from "../ui/QueryMonitorDisplay.js";
11
10
  import { useTabBar } from "../ui/TabBar.js";
11
+ import { normalizeEditLink } from "../../lib/edit-link.js";
12
12
  function RouteDetails(props) {
13
13
  const { route } = props;
14
14
  const admin = route.meta.admin;
@@ -25,7 +25,7 @@ function RouteDetails(props) {
25
25
  }, className: "underline", children: route.uri }));
26
26
  addRow("Route ID", _jsx(_Fragment, { children: route.id }));
27
27
  if (admin?.editLink) {
28
- const actualUrl = env.serverless ? withoutHost(admin.editLink) : admin.editLink;
28
+ const actualUrl = normalizeEditLink(admin.editLink);
29
29
  addRow("Edit", _jsx("a", { href: actualUrl, className: "underline", target: "_blank", children: actualUrl || "N/A" }));
30
30
  }
31
31
  addRow("WP Route", _jsxs(ChipGroup, { children: [admin?.kind === "archive" ? (_jsx(Chip, { label: "Archive", value: admin.postType })) : admin?.kind === "post" ? (_jsxs(_Fragment, { children: [!!admin?.postType && _jsx(Chip, { label: "Post Type", value: admin?.postType }), !!admin?.postId && _jsx(Chip, { label: "ID", value: admin?.postId })] })) : admin?.kind === "taxonomy" ? (_jsxs(_Fragment, { children: [!!admin?.taxonomy && _jsx(Chip, { label: "Taxonomy", value: admin?.taxonomy }), !!admin?.termId && _jsx(Chip, { label: "Term ID", value: admin?.termId })] })) : admin?.kind === "404" ? (_jsx(_Fragment, { children: _jsx(Chip, { value: "Not Found" }) })) : null, !!admin?.customRoute && (_jsxs(_Fragment, { children: [_jsx(Chip, { value: "Custom Route" }), !!admin?.customRoute.pattern && _jsx(Chip, { label: "Pattern", value: admin?.customRoute.pattern }), !!Object.keys(admin?.customRoute.params ?? {}).length && (_jsx(Chip, { label: "Custom Params", value: Object.keys(admin?.customRoute.params).join(", ") }))] }))] }));
@@ -59,5 +59,5 @@ export function RoutePanel() {
59
59
  useRouterEvents((event) => {
60
60
  console.log(`%c${event.type}`, "color: #000000; background-color: #7fdbca; padding-inline: 2px; font-weight: bold;", event);
61
61
  });
62
- return (_jsxs(Panel, { title: "Route Data", widgets: tabs.tabBar, padded: true, id: "route", children: [tabs.tab === "active" && (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(RouteDetails, { route: router.activeRoute, index: router.history.length, active: true }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1", children: "Page Props:" }), _jsx("div", { className: "max-h-[400px] overflow-auto", children: _jsx(JSONInspector, { data: router.activeRoute.props, detailed: true, expandLevel: 4 }) })] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1", children: "Query Log:" }), _jsx(QueryMonitorDisplay, { entries: router.activeRoute.queryMonitor })] })] })), tabs.tab === "history" && (_jsx("div", { className: "flex flex-col gap-1", children: router.history.map((item, index) => (_jsx(RouteDetails, { route: item, index: index, historyDepth: router.history.length - index - 1, active: router.activeRoute === item, compact: true }, item.id))) }))] }));
62
+ return (_jsxs(_Fragment, { children: [_jsx(PanelWidgets, { children: tabs.tabBar }), tabs.tab === "active" && (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(RouteDetails, { route: router.activeRoute, index: router.history.length, active: true }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1", children: "Page Props:" }), _jsx("div", { className: "max-h-[400px] overflow-auto", children: _jsx(JSONInspector, { data: router.activeRoute.props, detailed: true, expandLevel: 4 }) })] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1", children: "Query Log:" }), _jsx(QueryMonitorDisplay, { entries: router.activeRoute.queryMonitor })] })] })), tabs.tab === "history" && (_jsx("div", { className: "flex flex-col gap-1", children: router.history.map((item, index) => (_jsx(RouteDetails, { route: item, index: index, historyDepth: router.history.length - index - 1, active: router.activeRoute === item, compact: true }, item.id))) }))] }));
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StructurePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/StructurePanel.tsx"],"names":[],"mappings":"AAYA,wBAAgB,cAAc,gCAyG7B"}
1
+ {"version":3,"file":"StructurePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/StructurePanel.tsx"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,gCAuG7B"}
@@ -6,7 +6,6 @@ import { usePersistState } from "../../hooks/usePersistState.js";
6
6
  import { blocksIcon, code, globeIcon, jumpTo, routesIcon, singleBlockIcon } from "../../icons.js";
7
7
  import { Expander } from "../ui/Expander.js";
8
8
  import { JSONInspector } from "../ui/JSONInspector.js";
9
- import { Panel } from "../ui/Panel.js";
10
9
  import { FullRouteDetails } from "./RoutePanel.js";
11
10
  import { AppDetails } from "./AppDataPanel.js";
12
11
  export function StructurePanel() {
@@ -25,7 +24,7 @@ export function StructurePanel() {
25
24
  let nodeDetails = null;
26
25
  if (selectedNode) {
27
26
  if (selectedNode.type === "block") {
28
- nodeDetails = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-bold mb-1", children: ["Block: ", selectedNode.block.slug] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1 text-white/80", children: "Inline Data:" }), _jsx("div", { className: "max-h-[400px] overflow-auto", children: Object.entries(selectedNode.context?.values ?? {}).map(([key, value]) => (_jsxs("div", { className: "flex ", children: [_jsxs("div", { className: "font-mono text-sm text-cyan-400 w-[150px] break-words", children: [key, ":"] }), _jsx("div", { className: "ml-2 flex-1", children: _jsx(JSONInspector, { data: value, expandLevel: 2 }) })] }, key))) })] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1 text-white/80", children: "Props:" }), _jsx("div", { className: "max-h-[400px] overflow-auto", children: _jsx(JSONInspector, { data: selectedNode.block.props, detailed: true, expandLevel: 4 }) })] })] }));
27
+ nodeDetails = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-bold mb-1", children: ["Block: ", selectedNode.block.slug] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1 text-white/80", children: "Inline Data:" }), _jsx("div", { className: "max-h-[400px] overflow-auto", children: Object.entries(selectedNode.context?.values ?? {}).map(([key, value]) => (_jsxs("div", { className: "flex ", children: [_jsxs("div", { className: "font-mono text-sm text-cyan-400 w-[min(30%,250px)] break-words", children: [key, ":"] }), _jsx("div", { className: "ml-2 flex-1", children: _jsx(JSONInspector, { data: value, expandLevel: 2 }) })] }, key))) })] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1 text-white/80", children: "Props:" }), _jsx("div", { className: "max-h-[400px] overflow-auto", children: _jsx(JSONInspector, { data: selectedNode.block.props, detailed: true, expandLevel: 4 }) })] })] }));
29
28
  }
30
29
  else if (selectedNode.type === "route" && !!selectedNode.route) {
31
30
  nodeDetails = _jsx(FullRouteDetails, { route: selectedNode.route });
@@ -50,7 +49,7 @@ export function StructurePanel() {
50
49
  })] })] })] }));
51
50
  }
52
51
  }
53
- return (_jsx(Panel, { title: "Structure", id: "structure", padded: false, children: _jsxs("div", { className: "flex flex-row h-full", children: [_jsx("div", { className: "overflow-auto border-r border-r-neutral-800 p-2", children: _jsx(StructureNode, { node: root, indent: 0, selectedId: blockId, onSelect: (id) => setBlockId(id) }) }), _jsx("div", { className: "overflow-auto max-w-[500px] flex flex-col gap-2 p-3", children: nodeDetails })] }) }));
52
+ return (_jsxs("div", { className: "flex flex-1 min-h-0 min-w-0 w-full flex-row", children: [_jsx("div", { className: "min-w-0 overflow-auto border-r border-r-neutral-800 p-2", children: _jsx(StructureNode, { node: root, indent: 0, selectedId: blockId, onSelect: (id) => setBlockId(id) }) }), _jsx("div", { className: "min-w-0 flex-1 overflow-auto flex flex-col gap-2 p-3", children: nodeDetails })] }));
54
53
  }
55
54
  function StructureNode(props) {
56
55
  const node = props.node;
@@ -3,6 +3,7 @@ type Panel = {
3
3
  label: string;
4
4
  icon: ReactNode;
5
5
  component: ComponentType;
6
+ padded: boolean;
6
7
  };
7
8
  export type DevPanelName = "appData" | "route" | "queries" | "structure";
8
9
  export declare const DEV_TOOLS_PANELS: Record<DevPanelName, Panel>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOhD,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,aAAa,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAA;AAExE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,KAAK,CAqBxD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOhD,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,aAAa,CAAA;IACxB,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAA;AAExE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,KAAK,CAyBxD,CAAA"}
@@ -4,24 +4,28 @@ import { RoutePanel } from "./RoutePanel.js";
4
4
  import { QueriesPanel } from "./QueriesPanel.js";
5
5
  import { StructurePanel } from "./StructurePanel.js";
6
6
  export const DEV_TOOLS_PANELS = {
7
- appData: {
8
- label: "App Data",
9
- icon: globeIcon,
10
- component: AppDataPanel,
7
+ structure: {
8
+ label: "Structure",
9
+ icon: blocksIcon,
10
+ component: StructurePanel,
11
+ padded: false,
11
12
  },
12
13
  route: {
13
14
  label: "Route",
14
15
  icon: routesIcon,
15
16
  component: RoutePanel,
17
+ padded: true,
16
18
  },
17
19
  queries: {
18
20
  label: "Queries",
19
21
  icon: structure,
20
22
  component: QueriesPanel,
23
+ padded: true,
21
24
  },
22
- structure: {
23
- label: "Structure",
24
- icon: blocksIcon,
25
- component: StructurePanel,
25
+ appData: {
26
+ label: "App Data",
27
+ icon: globeIcon,
28
+ component: AppDataPanel,
29
+ padded: true,
26
30
  },
27
31
  };
@@ -1,8 +1,9 @@
1
- import { ComponentProps } from "react";
2
- type Props = ComponentProps<"button"> & {
1
+ import { ComponentProps, ReactNode } from "react";
2
+ type Props = ComponentProps<"a"> & {
3
3
  shape?: "icon" | "default";
4
4
  variant?: "tab" | "button" | "subtle";
5
5
  active?: boolean;
6
+ tooltip?: ReactNode;
6
7
  };
7
8
  export declare function Button({ active, shape, variant, ...props }: Props): import("react").JSX.Element;
8
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC,KAAK,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACrC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,+BAUjE"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAG3D,KAAK,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACrC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,+BA+CjE"}
@@ -1,4 +1,24 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { createPortal } from "react-dom";
2
4
  export function Button({ active, shape, variant, ...props }) {
3
- return (_jsx("button", { className: "btn", "data-shape": shape ?? "default", "data-variant": variant ?? "button", "data-active": active ? "" : undefined, ...props }));
5
+ const [showTooltip, setShowTooltip] = useState(null);
6
+ const tooltipText = props.tooltip || props.title;
7
+ const Tag = (props.href ? "a" : "button");
8
+ return (_jsxs(_Fragment, { children: [_jsx(Tag, { className: "btn", "data-shape": shape ?? "default", "data-variant": variant ?? "button", "data-active": active ? "" : undefined, ...props, title: undefined, onPointerEnter: (e) => {
9
+ props.onPointerEnter?.(e);
10
+ const bounds = e.currentTarget.getBoundingClientRect();
11
+ setShowTooltip({
12
+ x: bounds.x,
13
+ y: bounds.y,
14
+ });
15
+ }, onPointerLeave: (e) => {
16
+ props.onPointerLeave?.(e);
17
+ setShowTooltip(null);
18
+ } }), showTooltip &&
19
+ !!tooltipText &&
20
+ createPortal(_jsx("div", { className: "fixed z-[10000000000] pointer-events-none w-[150px] flex justify-start -translate-y-[calc(100%+5px)]", style: {
21
+ left: showTooltip.x,
22
+ top: showTooltip.y,
23
+ }, children: _jsx("div", { className: "bg-neutral-900 text-tiny text-neutral-200 border border-neutral-600 px-2 py-1 rounded-md max-w-[150px] opacity-80", children: tooltipText }) }), document.getElementById("eddev-ui"))] }));
4
24
  }
@@ -9,7 +9,7 @@ export function JSONInspector(props) {
9
9
  return _jsx("div", { className: "text-ui text-neutral-500 italic", children: String(props.data) });
10
10
  }
11
11
  if (props.detailed) {
12
- return (_jsxs("div", { className: "relative pr-[85px]", children: [_jsxs("div", { className: "absolute top-0 right-0 text-tiny flex gap-1 bg-neutral-600 px-1", children: [bytesToSize(JSON.stringify(props.data).length), _jsx("button", { className: "underline", onClick: () => setRawMode(!rawMode), children: rawMode ? "INSPECT" : "RAW" })] }), rawMode ? (_jsx("textarea", { className: "w-full bg-transparent text-inherit resize-none [field-sizing:content] outline-none font-mono text-ui", readOnly: true, value: JSON.stringify(props.data, null, 2) })) : (inspector)] }));
12
+ return (_jsxs("div", { className: "relative", children: [_jsxs("div", { className: "absolute top-0 right-0 text-tiny flex gap-1 bg-neutral-600 px-1", children: [bytesToSize(JSON.stringify(props.data).length), _jsx("button", { className: "underline", onClick: () => setRawMode(!rawMode), children: rawMode ? "INSPECT" : "RAW" })] }), rawMode ? (_jsx("textarea", { className: "w-full bg-white/5 p-2 text-inherit resize-none [field-sizing:content] outline-none font-mono text-ui", readOnly: true, value: JSON.stringify(props.data, null, 2) })) : (_jsx("div", { className: "pr-[85px]", children: inspector }))] }));
13
13
  }
14
14
  else {
15
15
  return inspector;
@@ -4,14 +4,17 @@ type Size = {
4
4
  height: number;
5
5
  };
6
6
  type Props = {
7
- title: string;
8
- widgets?: ReactNode;
7
+ title?: string;
8
+ header?: ReactNode;
9
9
  children: ReactNode;
10
10
  padded?: boolean;
11
11
  id: string;
12
12
  defaultSize?: Size;
13
13
  resizeable?: boolean;
14
14
  };
15
+ export declare function PanelWidgets(props: {
16
+ children: ReactNode;
17
+ }): import("react").ReactPortal | null;
15
18
  export declare function Panel(props: Props): import("react").JSX.Element;
16
19
  export {};
17
20
  //# sourceMappingURL=Panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,OAAO,CAAA;AAIzC,KAAK,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7C,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,IAAI,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,+BA6BjC"}
1
+ {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAgC,MAAM,OAAO,CAAA;AAI9E,KAAK,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7C,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,IAAI,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,sCAG1D;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,+BAkCjC"}
@@ -1,10 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useRef } from "react";
2
+ import { createContext, useContext, useRef, useState } from "react";
3
+ import { createPortal } from "react-dom";
3
4
  import { usePersistState } from "../../hooks/usePersistState.js";
5
+ const PanelWidgetsContext = createContext(null);
6
+ export function PanelWidgets(props) {
7
+ const container = useContext(PanelWidgetsContext);
8
+ return container ? createPortal(props.children, container) : null;
9
+ }
4
10
  export function Panel(props) {
5
11
  const ref = useRef(null);
12
+ const [widgetsContainer, setWidgetsContainer] = useState(null);
6
13
  const [size, setSize] = usePersistState(`devtools-panel-size-${props.id}`, props.defaultSize ?? null);
7
- return (_jsxs("div", { ref: ref, className: "bg-black text-white rounded-md shadow-md border border-neutral-800 max-w-[calc(100vw-16px)] max-h-[calc(100vh-90px)] relative flex flex-col", style: size && props.resizeable !== false ? { width: size.width, height: size.height } : {}, children: [_jsxs("div", { className: "flex-none px-3 py-2 border-b border-neutral-800 flex justify-between items-center gap-4", children: [_jsx("div", { className: "text-heading pt-1", children: props.title }), _jsx("div", { children: props.widgets })] }), _jsx("div", { className: `overflow-auto overscroll-contain flex-1 flex flex-col ${props.padded ? "p-3" : ""}`, children: props.children }), props.resizeable !== false && (_jsxs(_Fragment, { children: [_jsx(ResizeHandle, { panelRef: ref, side: "right", onResize: setSize }), _jsx(ResizeHandle, { panelRef: ref, side: "top", onResize: setSize }), _jsx(ResizeHandle, { panelRef: ref, side: "tr", onResize: setSize })] }))] }));
14
+ return (_jsx(PanelWidgetsContext.Provider, { value: widgetsContainer, children: _jsxs("div", { ref: ref, className: "bg-black text-white rounded-lg shadow-md border border-neutral-800 max-w-[calc(100vw-16px)] max-h-[calc(100vh-90px)] relative flex flex-col", style: size && props.resizeable !== false ? { width: size.width, height: size.height } : {}, children: [_jsx("div", { className: "flex-none px-3 py-2 border-b border-neutral-800 flex justify-between items-center gap-4 overflow-x-auto eddev-no-scrollbars", children: _jsxs("div", { className: "flex w-full min-w-max gap-4 justify-between", children: [_jsx("div", { className: props.header ? "min-w-0" : "text-heading pt-1", children: props.header ?? props.title }), _jsx("div", { ref: setWidgetsContainer, className: "flex flex-none items-center justify-end gap-2" })] }) }), _jsx("div", { className: `overflow-auto overscroll-contain flex-1 flex flex-col ${props.padded ? "p-3" : ""}`, children: props.children }), props.resizeable !== false && (_jsxs(_Fragment, { children: [_jsx(ResizeHandle, { panelRef: ref, side: "right", onResize: setSize }), _jsx(ResizeHandle, { panelRef: ref, side: "top", onResize: setSize }), _jsx(ResizeHandle, { panelRef: ref, side: "tr", onResize: setSize })] }))] }) }));
8
15
  }
9
16
  function ResizeHandle(props) {
10
17
  let sideClass = "";
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { usePersistState } from "../../hooks/usePersistState.js";
3
3
  import { Button } from "./Button.js";
4
4
  export function TabBar(props) {
5
- return (_jsx("div", { className: "flex gap-2 flex-none p-2 pb-0", children: props.tabs.map((t) => (_jsxs(Button, { variant: "tab", active: props.activeTab === t.value, onClick: () => props.onTabChange?.(t.value), children: [t.label, t.badge ? _jsx("span", { className: "bg-neutral-200/20 rounded-md px-1", children: t.badge }) : null] }, t.value))) }));
5
+ return (_jsx("div", { className: "flex gap-2 flex-none", children: props.tabs.map((t) => (_jsxs(Button, { variant: "tab", active: props.activeTab === t.value, onClick: () => props.onTabChange?.(t.value), children: [t.label, t.badge ? _jsx("span", { className: "bg-neutral-200/20 rounded-md px-1", children: t.badge }) : null] }, t.value))) }));
6
6
  }
7
7
  export function useTabBar(id, tabs) {
8
8
  const [tab, setTab] = usePersistState(`tab:${id}`, tabs[0].value);
@@ -22,4 +22,7 @@ export declare const query: import("react").JSX.Element;
22
22
  export declare const singleBlockIcon: import("react").JSX.Element;
23
23
  export declare const globeIcon: import("react").JSX.Element;
24
24
  export declare const jumpTo: import("react").JSX.Element;
25
+ export declare const pencil: import("react").JSX.Element;
26
+ export declare const gridOn: import("react").JSX.Element;
27
+ export declare const gridOff: import("react").JSX.Element;
25
28
  //# sourceMappingURL=icons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/devtools/icons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BAShB,CAAA;AAED,eAAO,MAAM,UAAU,6BAItB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,OAAO,6BAInB,CAAA;AAED,eAAO,MAAM,UAAU,6BAItB,CAAA;AAED,eAAO,MAAM,UAAU,6BAItB,CAAA;AAED,eAAO,MAAM,SAAS,6BAcrB,CAAA;AAED,eAAO,MAAM,IAAI,6BAKhB,CAAA;AAED,eAAO,MAAM,KAAK,6BA0BjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,UAAU,6BAKtB,CAAA;AAED,eAAO,MAAM,WAAW,6BAKvB,CAAA;AAED,eAAO,MAAM,IAAI,6BAkBhB,CAAA;AAED,eAAO,MAAM,IAAI,6BAKhB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAIjB,CAAA;AAED,eAAO,MAAM,QAAQ,6BAIpB,CAAA;AAED,eAAO,MAAM,IAAI,6BAIhB,CAAA;AAED,eAAO,MAAM,KAAK,6BAIjB,CAAA;AAED,eAAO,MAAM,eAAe,6BAI3B,CAAA;AAED,eAAO,MAAM,SAAS,6BAIrB,CAAA;AAED,eAAO,MAAM,MAAM,6BAIlB,CAAA"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/devtools/icons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BAShB,CAAA;AAED,eAAO,MAAM,UAAU,6BAItB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,OAAO,6BAInB,CAAA;AAED,eAAO,MAAM,UAAU,6BAItB,CAAA;AAED,eAAO,MAAM,UAAU,6BAItB,CAAA;AAED,eAAO,MAAM,SAAS,6BAcrB,CAAA;AAED,eAAO,MAAM,IAAI,6BAKhB,CAAA;AAED,eAAO,MAAM,KAAK,6BA0BjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,UAAU,6BAKtB,CAAA;AAED,eAAO,MAAM,WAAW,6BAKvB,CAAA;AAED,eAAO,MAAM,IAAI,6BAkBhB,CAAA;AAED,eAAO,MAAM,IAAI,6BAKhB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAKjB,CAAA;AAED,eAAO,MAAM,KAAK,6BAIjB,CAAA;AAED,eAAO,MAAM,QAAQ,6BAIpB,CAAA;AAED,eAAO,MAAM,IAAI,6BAIhB,CAAA;AAED,eAAO,MAAM,KAAK,6BAIjB,CAAA;AAED,eAAO,MAAM,eAAe,6BAI3B,CAAA;AAED,eAAO,MAAM,SAAS,6BAIrB,CAAA;AAED,eAAO,MAAM,MAAM,6BAIlB,CAAA;AAED,eAAO,MAAM,MAAM,6BAIlB,CAAA;AAED,eAAO,MAAM,MAAM,6BAIlB,CAAA;AAED,eAAO,MAAM,OAAO,6BAInB,CAAA"}
@@ -23,3 +23,6 @@ export const query = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height:
23
23
  export const singleBlockIcon = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#e3e3e3", children: _jsx("path", { d: "M480-68 120-275v-410l360-207 360 207v410L480-68Zm-40-389v274l40 23 40-23v-274l240-139v-42l-43-25-237 137-237-137-43 25v42l240 139Z" }) }));
24
24
  export const globeIcon = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#e3e3e3", children: _jsx("path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-7-.5-14.5T799-507q-5 29-27 48t-52 19h-80q-33 0-56.5-23.5T560-520v-40H400v-80q0-33 23.5-56.5T480-720h40q0-23 12.5-40.5T563-789q-20-5-40.5-8t-42.5-3q-134 0-227 93t-93 227h200q66 0 113 47t47 113v40H400v110q20 5 39.5 7.5T480-160Z" }) }));
25
25
  export const jumpTo = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#e3e3e3", children: _jsx("path", { d: "M440-440v-160h80v80h80v80H440Zm280 0v-80h80v-80h80v160H720ZM440-720v-160h160v80h-80v80h-80Zm360 0v-80h-80v-80h160v160h-80ZM136-80l-56-56 224-224H120v-80h320v320h-80v-184L136-80Z" }) }));
26
+ export const pencil = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#e3e3e3", children: _jsx("path", { d: "M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z" }) }));
27
+ export const gridOn = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#e3e3e3", children: _jsx("path", { d: "M320-160v-160H160v-80h160v-160H160v-80h160v-160h80v160h160v-160h80v160h160v80H640v160h160v80H640v160h-80v-160H400v160h-80Zm80-240h160v-160H400v160Z" }) }));
28
+ export const gridOff = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#e3e3e3", children: _jsx("path", { d: "m753-320-80-80h127v80h-47ZM640-433 433-640h127v-160h80v160h160v80H640v127ZM400-673l-80-80v-47h80v127ZM791-56 640-207v47h-80v-127l-33-33H400v160h-80v-160H160v-80h160v-127l-33-33H160v-80h47L56-791l56-57 736 736-57 56Z" }) }));
@@ -0,0 +1,2 @@
1
+ export declare function normalizeEditLink(editLink: string): string;
2
+ //# sourceMappingURL=edit-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-link.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/lib/edit-link.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,UAEjD"}
@@ -0,0 +1,4 @@
1
+ import { withoutHost } from "ufo";
2
+ export function normalizeEditLink(editLink) {
3
+ return env.serverless ? withoutHost(editLink) : editLink;
4
+ }
@@ -9,6 +9,7 @@ declare const _default: {
9
9
  };
10
10
  fontSize: {
11
11
  ui: [string, string];
12
+ logo: [string, string];
12
13
  heading: [string, string];
13
14
  tiny: [string, string];
14
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.config.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/devtools/tailwind.config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBA2BkB"}
1
+ {"version":3,"file":"tailwind.config.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/devtools/tailwind.config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBA4BkB"}
@@ -1,7 +1,7 @@
1
1
  // @ts-ignore
2
2
  export default {
3
3
  darkMode: [],
4
- important: ".eddev-ui",
4
+ important: "#eddev-ui",
5
5
  // @ts-ignore
6
6
  content: [__dirname + "/**/*.{js,jsx,ts,tsx}"],
7
7
  theme: {
@@ -11,6 +11,7 @@ export default {
11
11
  },
12
12
  fontSize: {
13
13
  ui: ["12px", "16px"],
14
+ logo: ["16px", "18px"],
14
15
  heading: ["18px", "20px"],
15
16
  tiny: ["10px", "14px"],
16
17
  },
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.3.21";
1
+ export declare const VERSION = "2.3.22";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- export const VERSION = "2.3.21";
1
+ export const VERSION = "2.3.22";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.3.21",
3
+ "version": "2.3.22",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,2 +0,0 @@
1
- export declare function GridIndicator(): import("react").ReactPortal | null;
2
- //# sourceMappingURL=GridIndicator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GridIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/GridIndicator.tsx"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,uCAmC5B"}
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useLayoutEffect } from "react";
3
- import { usePersistState } from "../hooks/usePersistState.js";
4
- import { createPortal } from "react-dom";
5
- export function GridIndicator() {
6
- const [enabled, setEnabled] = usePersistState("gridOverlayEnabled", false);
7
- useEffect(() => {
8
- const handleKeyDown = (e) => {
9
- if (e.key === "g" && e.ctrlKey) {
10
- setEnabled((e) => !e);
11
- }
12
- };
13
- window.addEventListener("keydown", handleKeyDown);
14
- return () => {
15
- window.removeEventListener("keydown", handleKeyDown);
16
- };
17
- }, []);
18
- const cols = [];
19
- for (let i = 0; i < 12; i++) {
20
- cols.push(_jsx("div", { style: { height: "100%", backgroundColor: "rgba(255,0,0,0.1)" } }, i));
21
- }
22
- if (env.client) {
23
- useLayoutEffect(() => {
24
- document.documentElement.classList.toggle("debug-grid", enabled);
25
- }, [enabled]);
26
- }
27
- if (!enabled)
28
- return null;
29
- return createPortal(_jsx("div", { style: { zIndex: 10000000, position: "fixed", inset: 0, pointerEvents: "none" }, children: _jsx("div", { className: "grid-auto", style: { height: "100%" }, children: cols }) }), document.body);
30
- }