eddev 2.1.6 → 2.2.0-beta.1
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/.yarn/install-state.gz +0 -0
- package/css/devtools.css +141 -1
- package/dist/app/entry/spa-root.d.ts.map +1 -1
- package/dist/app/entry/spa-root.js +3 -3
- package/dist/app/entry/ssr-root-client.d.ts.map +1 -1
- package/dist/app/entry/ssr-root-client.js +2 -2
- package/dist/app/entry/ssr-root.js +1 -1
- package/dist/app/lib/blocks/ContentBlocks.d.ts.map +1 -1
- package/dist/app/lib/blocks/ContentBlocks.js +16 -9
- package/dist/app/lib/blocks/block-debugger.d.ts +64 -0
- package/dist/app/lib/blocks/block-debugger.d.ts.map +1 -0
- package/dist/app/lib/blocks/block-debugger.js +157 -0
- package/dist/app/lib/blocks/editor/editor-config.d.ts +1 -1
- package/dist/app/lib/blocks/editor/editor-config.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/editor-config.js +19 -11
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts +1 -1
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/installGutenbergHooks.js +12 -0
- package/dist/app/lib/blocks/index.d.ts +1 -0
- package/dist/app/lib/blocks/index.d.ts.map +1 -1
- package/dist/app/lib/blocks/index.js +1 -0
- package/dist/app/lib/blocks/inline-editing.d.ts +2 -1
- package/dist/app/lib/blocks/inline-editing.d.ts.map +1 -1
- package/dist/app/lib/blocks/inline-editing.js +3 -1
- package/dist/app/lib/devtools/components/DevMenu.d.ts +2 -0
- package/dist/app/lib/devtools/components/DevMenu.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/DevMenu.js +19 -0
- package/dist/app/lib/devtools/components/DevUI.d.ts +13 -0
- package/dist/app/lib/devtools/components/DevUI.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/DevUI.js +28 -1
- package/dist/app/lib/devtools/components/GridIndicator.d.ts +1 -1
- package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/GridIndicator.js +2 -1
- package/dist/app/lib/devtools/components/panels/AppDataPanel.d.ts +2 -0
- package/dist/app/lib/devtools/components/panels/AppDataPanel.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/panels/AppDataPanel.js +12 -0
- package/dist/app/lib/devtools/components/panels/QueriesPanel.d.ts +2 -0
- package/dist/app/lib/devtools/components/panels/QueriesPanel.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/panels/QueriesPanel.js +5 -0
- package/dist/app/lib/devtools/components/panels/RoutePanel.d.ts +2 -0
- package/dist/app/lib/devtools/components/panels/RoutePanel.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/panels/RoutePanel.js +58 -0
- package/dist/app/lib/devtools/components/panels/StructurePanel.d.ts +2 -0
- package/dist/app/lib/devtools/components/panels/StructurePanel.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/panels/StructurePanel.js +138 -0
- package/dist/app/lib/devtools/components/panels/index.d.ts +10 -0
- package/dist/app/lib/devtools/components/panels/index.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/panels/index.js +27 -0
- package/dist/app/lib/devtools/components/panels/monaco-graphql.worker.d.ts +2 -0
- package/dist/app/lib/devtools/components/panels/monaco-graphql.worker.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/panels/monaco-graphql.worker.js +9 -0
- package/dist/app/lib/devtools/components/ui/Button.d.ts +9 -0
- package/dist/app/lib/devtools/components/ui/Button.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/Button.js +4 -0
- package/dist/app/lib/devtools/components/ui/Chip.d.ts +11 -0
- package/dist/app/lib/devtools/components/ui/Chip.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/Chip.js +7 -0
- package/dist/app/lib/devtools/components/ui/Expander.d.ts +8 -0
- package/dist/app/lib/devtools/components/ui/Expander.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/Expander.js +4 -0
- package/dist/app/lib/devtools/components/ui/JSONInspector.d.ts +8 -0
- package/dist/app/lib/devtools/components/ui/JSONInspector.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/JSONInspector.js +17 -0
- package/dist/app/lib/devtools/components/ui/Panel.d.ts +10 -0
- package/dist/app/lib/devtools/components/ui/Panel.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/Panel.js +4 -0
- package/dist/app/lib/devtools/components/ui/QueryMonitorDisplay.d.ts +7 -0
- package/dist/app/lib/devtools/components/ui/QueryMonitorDisplay.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/QueryMonitorDisplay.js +58 -0
- package/dist/app/lib/devtools/components/ui/TabBar.d.ts +22 -0
- package/dist/app/lib/devtools/components/ui/TabBar.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/TabBar.js +11 -0
- package/dist/app/lib/devtools/components/ui/Tabs.d.ts +13 -0
- package/dist/app/lib/devtools/components/ui/Tabs.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/ui/Tabs.js +7 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts +3 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts.map +1 -1
- package/dist/app/lib/devtools/hooks/usePersistState.js +7 -0
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +5227 -1
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts.map +1 -1
- package/dist/app/lib/devtools/icons.d.ts +25 -0
- package/dist/app/lib/devtools/icons.d.ts.map +1 -0
- package/dist/app/lib/devtools/icons.js +25 -0
- package/dist/app/lib/devtools/lib/filesize.d.ts +2 -0
- package/dist/app/lib/devtools/lib/filesize.d.ts.map +1 -0
- package/dist/app/lib/devtools/lib/filesize.js +7 -0
- package/dist/app/lib/devtools/tailwind.config.d.ts +27 -1
- package/dist/app/lib/devtools/tailwind.config.d.ts.map +1 -1
- package/dist/app/lib/devtools/tailwind.config.js +6 -1
- package/dist/app/lib/hooks/useAppData.d.ts +2 -0
- package/dist/app/lib/hooks/useAppData.d.ts.map +1 -1
- package/dist/app/lib/hooks/useAppData.js +8 -0
- package/dist/app/lib/internal/read-admin-manifest.d.ts +2 -0
- package/dist/app/lib/internal/read-admin-manifest.d.ts.map +1 -1
- package/dist/app/lib/internal/read-admin-manifest.js +1 -0
- package/dist/app/lib/legacy-stitches/createStitches.d.ts +9 -9
- package/dist/app/lib/legacy-stitches/createStitches.d.ts.map +1 -1
- package/dist/app/lib/routing/components/BrowserRouter.d.ts.map +1 -1
- package/dist/app/lib/routing/components/BrowserRouter.js +22 -6
- package/dist/app/lib/routing/components/RouteRenderer.d.ts.map +1 -1
- package/dist/app/lib/routing/components/RouteRenderer.js +16 -4
- package/dist/app/lib/routing/loader.d.ts +3 -1
- package/dist/app/lib/routing/loader.d.ts.map +1 -1
- package/dist/app/lib/routing/loader.js +3 -1
- package/dist/app/lib/routing/types.d.ts +19 -2
- package/dist/app/lib/routing/types.d.ts.map +1 -1
- package/dist/app/lib/routing/utils.d.ts +1 -0
- package/dist/app/lib/routing/utils.d.ts.map +1 -1
- package/dist/app/lib/routing/utils.js +19 -1
- package/dist/app/server/server-context.d.ts.map +1 -1
- package/dist/app/server/server-context.js +23 -9
- package/dist/app/server/utils/replace-host.d.ts.map +1 -1
- package/dist/app/utils/query-monitor.d.ts +8 -2
- package/dist/app/utils/query-monitor.d.ts.map +1 -1
- package/dist/node/cli/cli.js +9 -0
- package/dist/node/cli/display/CLIApp.d.ts.map +1 -1
- package/dist/node/cli/display/CLIApp.js +1 -0
- package/dist/node/cli/version.d.ts +1 -1
- package/dist/node/cli/version.d.ts.map +1 -1
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/get-vite-config.d.ts +1 -0
- package/dist/node/compiler/get-vite-config.d.ts.map +1 -1
- package/dist/node/compiler/get-vite-config.js +14 -0
- package/dist/node/compiler/vinxi-codegen.d.ts.map +1 -1
- package/dist/node/compiler/vinxi-codegen.js +15 -2
- package/dist/node/graphql/graphql-codegen.d.ts.map +1 -1
- package/dist/node/graphql/graphql-codegen.js +7 -0
- package/dist/node/project/config.d.ts +1 -1
- package/dist/node/project/eddev-build-file.d.ts.map +1 -1
- package/dist/node/project/eddev-build-file.js +1 -0
- package/dist/node/project/manifest/block-manifest.d.ts +4 -1
- package/dist/node/project/manifest/block-manifest.d.ts.map +1 -1
- package/dist/node/project/manifest/block-manifest.js +22 -1
- package/dist/node/types/block-type.d.ts +12 -1
- package/dist/node/types/block-type.d.ts.map +1 -1
- package/dist/node/types/block-type.js +6 -0
- package/dist/node/utils/fs.d.ts.map +1 -1
- package/dist/node/utils/helpers.d.ts.map +1 -1
- package/package.json +6 -4
- package/types.meta.d.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-editing.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/blocks/inline-editing.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAiB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"inline-editing.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/blocks/inline-editing.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useMemo } from "react";
|
|
2
|
+
import { createContext, useContext, useId, useMemo } from "react";
|
|
3
3
|
import { usePostEditor } from "./editor/usePostEditor.js";
|
|
4
4
|
import { useRoute } from "../routing/index.js";
|
|
5
5
|
import { addBlockMetadata } from "./block-utils.js";
|
|
6
6
|
export const InlineEditingContext = createContext(undefined);
|
|
7
7
|
export function InlineEditingContextProvider(props) {
|
|
8
8
|
const parentContext = useContext(InlineEditingContext);
|
|
9
|
+
const instanceId = useId();
|
|
9
10
|
useMemo(() => {
|
|
10
11
|
addBlockMetadata(props.innerBlocks ?? []);
|
|
11
12
|
}, [props.innerBlocks]);
|
|
@@ -30,6 +31,7 @@ export function InlineEditingContextProvider(props) {
|
|
|
30
31
|
insertBlocksAfter: props.insertBlocksAfter,
|
|
31
32
|
readonly: props.readonly || parentContext?.readonly,
|
|
32
33
|
editorBlock: props.editorBlock,
|
|
34
|
+
instanceId: instanceId,
|
|
33
35
|
}, children: props.children }));
|
|
34
36
|
}
|
|
35
37
|
export function ReadonlyInlineEditingProvider(props) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevMenu.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/DevMenu.tsx"],"names":[],"mappings":"AAKA,wBAAgB,OAAO,4CAoCtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { usePersistState } from "../hooks/usePersistState";
|
|
3
|
+
import { bolt, close } from "../icons";
|
|
4
|
+
import { DEV_TOOLS_PANELS } from "./panels";
|
|
5
|
+
import { Button } from "./ui/Button";
|
|
6
|
+
export function DevMenu() {
|
|
7
|
+
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, {}) }))] }));
|
|
19
|
+
}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import { Component, ErrorInfo, PropsWithChildren } from "react";
|
|
1
2
|
import "../../../../../css/devtools.css";
|
|
2
3
|
export default function DevUI(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
interface State {
|
|
5
|
+
hasError: boolean;
|
|
6
|
+
error?: Error;
|
|
7
|
+
errorInfo?: ErrorInfo;
|
|
8
|
+
}
|
|
9
|
+
export declare class ErrorBoundary extends Component<PropsWithChildren<{}>, State> {
|
|
10
|
+
state: State;
|
|
11
|
+
static getDerivedStateFromError(err: Error): State;
|
|
12
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
13
|
+
render(): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
3
16
|
//# sourceMappingURL=DevUI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevUI.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/DevUI.tsx"],"names":[],"mappings":"AAAA,OAAO,iCAAiC,CAAA;
|
|
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,4CAgB5B;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,7 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Component } from "react";
|
|
2
3
|
import "../../../../../css/devtools.css";
|
|
3
4
|
import { BreakpointIndicator } from "./BreakpointIndicator.js";
|
|
5
|
+
import { DevMenu } from "./DevMenu";
|
|
4
6
|
import { GridIndicator } from "./GridIndicator";
|
|
7
|
+
import { Panel } from "./ui/Panel";
|
|
8
|
+
import { Button } from "./ui/Button";
|
|
9
|
+
import { usePersistState } from "../hooks/usePersistState";
|
|
5
10
|
export default function DevUI() {
|
|
6
|
-
return (
|
|
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, {})] }) }) }) }));
|
|
12
|
+
}
|
|
13
|
+
export class ErrorBoundary extends Component {
|
|
14
|
+
state = {
|
|
15
|
+
hasError: false,
|
|
16
|
+
};
|
|
17
|
+
static getDerivedStateFromError(err) {
|
|
18
|
+
// Update state so the next render will show the fallback UI.
|
|
19
|
+
return { hasError: true, error: err };
|
|
20
|
+
}
|
|
21
|
+
componentDidCatch(error, errorInfo) {
|
|
22
|
+
console.error("Uncaught error:", error, errorInfo);
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
if (this.state.hasError) {
|
|
26
|
+
const err = this.state.error;
|
|
27
|
+
return (_jsx(Panel, { title: "Dev UI Error", padded: true, children: _jsxs("div", { className: "flex flex-col items-start gap-2", children: [_jsx("div", { className: "font-bold text-red-400", children: "An error occurred in the Dev UI:" }), _jsx("div", { className: "max-w-[40em] text-red-400 bg-red-950 p-2 rounded-sm", children: err.message }), _jsx(Button, { variant: "subtle", onClick: () => {
|
|
28
|
+
usePersistState.clearAll();
|
|
29
|
+
this.setState({ hasError: false, error: undefined, errorInfo: undefined });
|
|
30
|
+
}, children: "Reset Settings" })] }) }));
|
|
31
|
+
}
|
|
32
|
+
return this.props.children;
|
|
33
|
+
}
|
|
7
34
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function GridIndicator(): import("react
|
|
1
|
+
export declare function GridIndicator(): import("react").ReactPortal | null;
|
|
2
2
|
//# sourceMappingURL=GridIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/GridIndicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/devtools/components/GridIndicator.tsx"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,uCAmC5B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { usePersistState } from "../hooks/usePersistState.js";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
4
5
|
export function GridIndicator() {
|
|
5
6
|
const [enabled, setEnabled] = usePersistState("gridOverlayEnabled", false);
|
|
6
7
|
useEffect(() => {
|
|
@@ -25,5 +26,5 @@ export function GridIndicator() {
|
|
|
25
26
|
}
|
|
26
27
|
if (!enabled)
|
|
27
28
|
return null;
|
|
28
|
-
return (_jsx("div", { style: { position: "fixed", inset: 0,
|
|
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);
|
|
29
30
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppDataPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/AppDataPanel.tsx"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,4CAuB3B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAppData, useAppDataQueryMonitor } from "../../../hooks";
|
|
3
|
+
import { JSONInspector } from "../ui/JSONInspector";
|
|
4
|
+
import { Panel } from "../ui/Panel";
|
|
5
|
+
import { QueryMonitorDisplay } from "../ui/QueryMonitorDisplay";
|
|
6
|
+
// import { JsonInspector } from "@rexxars/react-json-inspector"
|
|
7
|
+
//
|
|
8
|
+
export function AppDataPanel() {
|
|
9
|
+
const appData = useAppData();
|
|
10
|
+
const queryMonitor = useAppDataQueryMonitor();
|
|
11
|
+
return (_jsx(Panel, { title: "App", padded: true, children: _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1", children: "App Data:" }), _jsx("div", { className: "max-h-[400px] overflow-auto", children: _jsx(JSONInspector, { data: appData, detailed: true, expandLevel: 4 }) })] }), queryMonitor && queryMonitor.length > 0 && (_jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1", children: "Query Log:" }), _jsx(QueryMonitorDisplay, { entries: queryMonitor })] }))] }) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueriesPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/QueriesPanel.tsx"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,4CAM3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoutePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/RoutePanel.tsx"],"names":[],"mappings":"AAmKA,wBAAgB,UAAU,4CAuDzB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRouter, useRouterEvents, useRouterState } from "../../../routing";
|
|
3
|
+
import { Panel } from "../ui/Panel";
|
|
4
|
+
import { Fragment, useEffect } from "react";
|
|
5
|
+
import { withoutHost } from "ufo";
|
|
6
|
+
import { terminal, undo } from "../../icons";
|
|
7
|
+
import { Button } from "../ui/Button";
|
|
8
|
+
import { Chip, ChipGroup } from "../ui/Chip";
|
|
9
|
+
import { JSONInspector } from "../ui/JSONInspector";
|
|
10
|
+
import { QueryMonitorDisplay } from "../ui/QueryMonitorDisplay";
|
|
11
|
+
import { useTabBar } from "../ui/TabBar";
|
|
12
|
+
function RouteDetails(props) {
|
|
13
|
+
const { route } = props;
|
|
14
|
+
const admin = route.meta.admin;
|
|
15
|
+
const router = useRouter();
|
|
16
|
+
let rows = [];
|
|
17
|
+
function addRow(label, contents) {
|
|
18
|
+
rows.push(_jsxs(Fragment, { children: [_jsx("div", { children: label }), _jsx("div", { children: contents })] }, rows.length));
|
|
19
|
+
}
|
|
20
|
+
addRow("URI", _jsx("a", { href: route.uri, onClick: (e) => {
|
|
21
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey)
|
|
22
|
+
return;
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
router.restoreRoute(route);
|
|
25
|
+
}, className: "underline", children: route.uri }));
|
|
26
|
+
addRow("Route ID", _jsx(_Fragment, { children: route.id }));
|
|
27
|
+
if (admin?.editLink) {
|
|
28
|
+
const actualUrl = env.serverless ? withoutHost(admin.editLink) : admin.editLink;
|
|
29
|
+
addRow("Edit", _jsx("a", { href: actualUrl, className: "underline", target: "_blank", children: actualUrl || "N/A" }));
|
|
30
|
+
}
|
|
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(", ") }))] }))] }));
|
|
32
|
+
addRow("View", _jsxs("div", { className: "text-white/50", children: [_jsx("span", { children: "views/" }), _jsx("span", { className: "text-white", children: route.view }), _jsx("span", { children: ".tsx" })] }));
|
|
33
|
+
addRow("Link Data", _jsx(JSONInspector, { data: route.linkData }));
|
|
34
|
+
if (route.returnState) {
|
|
35
|
+
addRow("Restore State", _jsx(JSONInspector, { data: route.returnState }));
|
|
36
|
+
}
|
|
37
|
+
addRow("GraphQL Vars", _jsx(ChipGroup, { children: Object.entries(route.meta.admin?.params ?? {}).map(([key, value]) => (_jsx(Chip, { label: key, value: String(value) }, key))) }));
|
|
38
|
+
if (props.compact) {
|
|
39
|
+
addRow("Props", _jsx("div", { className: "max-h-[400px] overflow-auto", children: _jsx(JSONInspector, { data: route.props, detailed: true, expandLevel: 0 }) }));
|
|
40
|
+
}
|
|
41
|
+
return (_jsxs("div", { className: "bg-neutral-800 rounded-md px-2 py-1 flex flex-col gap-1", children: [_jsxs("div", { className: "flex gap-2 text-ellipsis justify-between items-center", children: [_jsx("span", { className: "font-bold", children: route.meta.title }), _jsxs("div", { className: "flex gap-1 items-center", children: [props.active ? ("Current page") : (_jsxs(_Fragment, { children: [props.historyDepth === 1 ? "Previous page" : `${props.historyDepth} pages ago`, _jsx(Button, { variant: "subtle", title: "Restore", shape: "icon", onClick: () => window.history.go(-props.historyDepth), children: undo })] })), _jsx(Button, { title: "Log to Console", shape: "icon", variant: "subtle", onClick: () => {
|
|
42
|
+
console.log("Route Details:", route);
|
|
43
|
+
}, children: terminal })] })] }), _jsx("div", { className: "grid [grid-template-columns:120px_1fr] w-full gap-1", children: rows })] }));
|
|
44
|
+
}
|
|
45
|
+
export function RoutePanel() {
|
|
46
|
+
const router = useRouterState();
|
|
47
|
+
const tabs = useTabBar("router-panel", [
|
|
48
|
+
{ value: "active", label: "Active Route" },
|
|
49
|
+
{ value: "history", badge: String(router.history.length), label: "History" },
|
|
50
|
+
]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
console.info(`%cRouter logging enabled while Route Panel is open`, "color: #000000; background-color: #7fdbca; padding-inline: 2px; font-weight: bold;");
|
|
53
|
+
}, []);
|
|
54
|
+
useRouterEvents((event) => {
|
|
55
|
+
console.log(`%c${event.type}`, "color: #000000; background-color: #7fdbca; padding-inline: 2px; font-weight: bold;", event);
|
|
56
|
+
});
|
|
57
|
+
return (_jsxs(Panel, { title: "Route Data", widgets: tabs.tabBar, padded: true, 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))) }))] }));
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StructurePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/StructurePanel.tsx"],"names":[],"mappings":"AASA,wBAAgB,cAAc,4CAqG7B"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { useSnapshot } from "valtio";
|
|
4
|
+
import { pageStructureRoot } from "../../../blocks/block-debugger";
|
|
5
|
+
import { usePersistState } from "../../hooks/usePersistState";
|
|
6
|
+
import { blocksIcon, code, globeIcon, jumpTo, routesIcon, singleBlockIcon } from "../../icons";
|
|
7
|
+
import { Expander } from "../ui/Expander";
|
|
8
|
+
import { JSONInspector } from "../ui/JSONInspector";
|
|
9
|
+
import { Panel } from "../ui/Panel";
|
|
10
|
+
export function StructurePanel() {
|
|
11
|
+
const root = useSnapshot(pageStructureRoot);
|
|
12
|
+
const nodesById = useMemo(() => {
|
|
13
|
+
const map = new Map();
|
|
14
|
+
function traverse(node) {
|
|
15
|
+
map.set(node.id, node);
|
|
16
|
+
node.children.forEach(traverse);
|
|
17
|
+
}
|
|
18
|
+
traverse(root);
|
|
19
|
+
return map;
|
|
20
|
+
}, [root]);
|
|
21
|
+
const [blockId, setBlockId] = usePersistState("selectedBlockId", null);
|
|
22
|
+
const selectedNode = blockId ? nodesById.get(blockId) : null;
|
|
23
|
+
let nodeDetails = null;
|
|
24
|
+
if (selectedNode) {
|
|
25
|
+
if (selectedNode.type === "block") {
|
|
26
|
+
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
|
+
}
|
|
28
|
+
else if (selectedNode.type === "debug") {
|
|
29
|
+
const data = {
|
|
30
|
+
...selectedNode.data,
|
|
31
|
+
};
|
|
32
|
+
delete data.log;
|
|
33
|
+
nodeDetails = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-bold mb-1", children: ["Debug Node: ", selectedNode.label] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1 text-white/80", children: "Data:" }), _jsx("div", { children: _jsx(JSONInspector, { data: data, detailed: true, expandLevel: 4 }) })] }), _jsxs("div", { children: [_jsx("div", { className: "font-bold mb-1 text-white/80", children: "Log:" }), _jsxs("div", { children: [selectedNode.logEntries.length === 0 && _jsx("div", { className: "text-white/50 italic", children: "No log entries" }), selectedNode.logEntries.map((entry, index) => {
|
|
34
|
+
return (_jsxs("div", { className: "flex gap-2", children: [_jsxs("div", { className: "flex gap-1.5 flex-1 min-w-[200px]", children: [_jsx("span", { className: "text-white/50", children: ">" }), entry.args.map((part, partIndex) => {
|
|
35
|
+
if (typeof part === "string") {
|
|
36
|
+
return _jsx(_Fragment, { children: part });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return (_jsx("span", { className: "text-purple-400 inline-flex", onClick: (e) => e.stopPropagation(), children: _jsx(JSONInspector, { data: part }) }));
|
|
40
|
+
}
|
|
41
|
+
})] }), _jsx("div", { className: "text-white/30", children: entry.time.toLocaleTimeString() })] }, index));
|
|
42
|
+
})] })] })] }));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return (_jsx(Panel, { title: "Blocks", children: _jsxs("div", { className: "flex flex-row gap-3 p-3 min-h-[300px] max-h-[80vh]", children: [_jsx("div", { className: "overflow-auto", children: _jsx(StructureNode, { node: root, indent: 0, selectedId: blockId, onSelect: (id) => setBlockId(id) }) }), !!nodeDetails && _jsx("div", { className: "overflow-auto max-w-[500px] flex flex-col gap-2", children: nodeDetails })] }) }));
|
|
46
|
+
}
|
|
47
|
+
function StructureNode(props) {
|
|
48
|
+
const node = props.node;
|
|
49
|
+
let nodeId = node.id;
|
|
50
|
+
let label = null;
|
|
51
|
+
let widget = null;
|
|
52
|
+
let onHover = undefined;
|
|
53
|
+
if (node.type === "root") {
|
|
54
|
+
label = _jsxs(_Fragment, { children: [globeIcon, " Root"] });
|
|
55
|
+
}
|
|
56
|
+
else if (node.type === "route") {
|
|
57
|
+
label = (_jsxs(_Fragment, { children: [routesIcon, " Route: ", node.route.uri] }));
|
|
58
|
+
}
|
|
59
|
+
else if (node.type === "blocks") {
|
|
60
|
+
label = _jsxs(_Fragment, { children: [blocksIcon, " ContentBlocks"] });
|
|
61
|
+
}
|
|
62
|
+
else if (node.type === "debug") {
|
|
63
|
+
label = (_jsxs(_Fragment, { children: [code, " Debug: ", node.label] }));
|
|
64
|
+
}
|
|
65
|
+
else if (node.type === "block") {
|
|
66
|
+
label = (_jsxs(_Fragment, { children: [singleBlockIcon, " Block: ", node.block.slug] }));
|
|
67
|
+
nodeId = node.context?.instanceId || "";
|
|
68
|
+
}
|
|
69
|
+
if (node.type === "block" || node.type === "debug") {
|
|
70
|
+
if (node.getElements) {
|
|
71
|
+
widget = (_jsx("button", { onClick: (e) => {
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
const elements = node.getElements?.();
|
|
74
|
+
if (elements && elements.length) {
|
|
75
|
+
elements[0].scrollIntoView({ behavior: "smooth", block: "start" });
|
|
76
|
+
}
|
|
77
|
+
}, children: jumpTo }));
|
|
78
|
+
onHover = () => {
|
|
79
|
+
const elements = node.getElements?.();
|
|
80
|
+
const boundsDisplays = [];
|
|
81
|
+
if (elements?.length) {
|
|
82
|
+
for (const el of elements) {
|
|
83
|
+
const rect = el.getBoundingClientRect();
|
|
84
|
+
const boundsDisplay = document.createElement("div");
|
|
85
|
+
boundsDisplay.style.position = "fixed";
|
|
86
|
+
boundsDisplay.style.left = `${rect.left}px`;
|
|
87
|
+
boundsDisplay.style.top = `${rect.top}px`;
|
|
88
|
+
boundsDisplay.style.width = `${rect.width}px`;
|
|
89
|
+
boundsDisplay.style.height = `${rect.height}px`;
|
|
90
|
+
boundsDisplay.style.border = "2px solid rgba(255, 165, 0, 0.8)";
|
|
91
|
+
boundsDisplay.style.backgroundColor = "rgba(255, 165, 0, 0.2)";
|
|
92
|
+
boundsDisplay.style.pointerEvents = "none";
|
|
93
|
+
boundsDisplay.style.zIndex = "9999";
|
|
94
|
+
document.body.appendChild(boundsDisplay);
|
|
95
|
+
boundsDisplays.push(boundsDisplay);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return () => {
|
|
99
|
+
for (const bd of boundsDisplays) {
|
|
100
|
+
bd.remove();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const selected = props.selectedId === nodeId && nodeId !== "";
|
|
107
|
+
const cleanupHover = useRef(undefined);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
return () => {
|
|
110
|
+
cleanupHover.current?.();
|
|
111
|
+
};
|
|
112
|
+
}, []);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
const abort = new AbortController();
|
|
115
|
+
window.addEventListener("scroll", () => {
|
|
116
|
+
if (cleanupHover.current) {
|
|
117
|
+
cleanupHover.current();
|
|
118
|
+
cleanupHover.current = onHover ? onHover() : undefined;
|
|
119
|
+
}
|
|
120
|
+
}, { signal: abort.signal });
|
|
121
|
+
return () => {
|
|
122
|
+
abort.abort();
|
|
123
|
+
};
|
|
124
|
+
}, []);
|
|
125
|
+
const [expanded, setExpanded] = useState(true);
|
|
126
|
+
return (_jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: `flex justify-between gap-1 py-0.5 [&_svg]:size-[1.2em] items-center px-1 ${selected ? "bg-neutral-700" : "hover:bg-neutral-800"}`, style: { paddingLeft: `${props.indent * 1.25}em` }, onClick: () => {
|
|
127
|
+
props.onSelect(nodeId);
|
|
128
|
+
}, onMouseEnter: () => {
|
|
129
|
+
if (onHover) {
|
|
130
|
+
cleanupHover.current = onHover();
|
|
131
|
+
}
|
|
132
|
+
}, onMouseLeave: () => {
|
|
133
|
+
if (cleanupHover.current) {
|
|
134
|
+
cleanupHover.current();
|
|
135
|
+
cleanupHover.current = undefined;
|
|
136
|
+
}
|
|
137
|
+
}, children: [_jsx(Expander, { expanded: expanded, onChange: setExpanded, canExpand: node.children.length > 0, children: _jsx("div", { className: "flex flex-row", children: _jsx("div", { className: "text-white/70 inline-flex gap-1 items-center", children: label }) }) }), widget] }), node.children.length > 0 && (_jsx("div", { className: "flex flex-col", children: node.children.map((child, index) => (_jsx(StructureNode, { node: child, indent: props.indent + 1, selectedId: props.selectedId, onSelect: props.onSelect }, index))) }))] }));
|
|
138
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from "react";
|
|
2
|
+
type Panel = {
|
|
3
|
+
label: string;
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
component: ComponentType;
|
|
6
|
+
};
|
|
7
|
+
export type DevPanelName = "appData" | "route" | "queries" | "structure";
|
|
8
|
+
export declare const DEV_TOOLS_PANELS: Record<DevPanelName, Panel>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { blocksIcon, globeIcon, routesIcon, structure } from "../../icons";
|
|
2
|
+
import { AppDataPanel } from "./AppDataPanel";
|
|
3
|
+
import { RoutePanel } from "./RoutePanel";
|
|
4
|
+
import { QueriesPanel } from "./QueriesPanel";
|
|
5
|
+
import { StructurePanel } from "./StructurePanel";
|
|
6
|
+
export const DEV_TOOLS_PANELS = {
|
|
7
|
+
appData: {
|
|
8
|
+
label: "App Data",
|
|
9
|
+
icon: globeIcon,
|
|
10
|
+
component: AppDataPanel,
|
|
11
|
+
},
|
|
12
|
+
route: {
|
|
13
|
+
label: "Route",
|
|
14
|
+
icon: routesIcon,
|
|
15
|
+
component: RoutePanel,
|
|
16
|
+
},
|
|
17
|
+
queries: {
|
|
18
|
+
label: "Queries",
|
|
19
|
+
icon: structure,
|
|
20
|
+
component: QueriesPanel,
|
|
21
|
+
},
|
|
22
|
+
structure: {
|
|
23
|
+
label: "Structure",
|
|
24
|
+
icon: blocksIcon,
|
|
25
|
+
component: StructurePanel,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monaco-graphql.worker.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/panels/monaco-graphql.worker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// @ts-expect-error: worker entry
|
|
2
|
+
import { initialize } from "monaco-editor/esm/vs/editor/editor.worker";
|
|
3
|
+
import { GraphQLWorker } from "monaco-graphql/esm/GraphQLWorker.js";
|
|
4
|
+
globalThis.onmessage = () => {
|
|
5
|
+
initialize((ctx, createData) => {
|
|
6
|
+
// optional: tweak createData.languageConfig here
|
|
7
|
+
return new GraphQLWorker(ctx, createData);
|
|
8
|
+
});
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
type Props = ComponentProps<"button"> & {
|
|
3
|
+
shape?: "icon" | "default";
|
|
4
|
+
variant?: "tab" | "button" | "subtle";
|
|
5
|
+
active?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function Button({ active, shape, variant, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +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,2CAUjE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
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 }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
label?: string;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare function Chip(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function ChipGroup(props: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=Chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,2CAOhC;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAEvD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function Chip(props) {
|
|
3
|
+
return (_jsxs("span", { className: "inline-flex line-clamp-1 overflow-ellipsis bg-neutral-300/10 rounded-md px-[0.4em] py-[0.08em] gap-1", children: [props.label ? _jsxs("span", { className: "text-white/50", children: [props.label, ":"] }) : null, _jsx("span", { children: props.value })] }));
|
|
4
|
+
}
|
|
5
|
+
export function ChipGroup(props) {
|
|
6
|
+
return _jsx("div", { className: "flex flex-wrap gap-1 items-center", children: props.children });
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export declare function Expander(props: {
|
|
3
|
+
expanded: boolean;
|
|
4
|
+
onChange(expanded: boolean): void;
|
|
5
|
+
canExpand?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Expander.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Expander.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/Expander.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAA;IACjC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,2CAcA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Expander(props) {
|
|
3
|
+
return (_jsxs("span", { className: "inline-flex cursor-default items-start", onClick: () => props.canExpand !== false && props.onChange(!props.expanded), children: [_jsx("span", { className: `text-white/40 inline-flex mr-1 ${props.expanded ? "rotate-90" : ""} ${props.canExpand === false ? "opacity-0" : ""}`, children: "\u25B6" }), props.children] }));
|
|
4
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSONInspector.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/JSONInspector.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,GAAG,CAAA;IACT,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,2CA+BzC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ObjectInspector } from "react-inspector";
|
|
3
|
+
import { usePersistState } from "../../hooks/usePersistState";
|
|
4
|
+
import { bytesToSize } from "../../lib/filesize";
|
|
5
|
+
export function JSONInspector(props) {
|
|
6
|
+
const inspector = _jsx(ObjectInspector, { data: props.data, theme: "chromeDark", expandLevel: props.expandLevel });
|
|
7
|
+
const [rawMode, setRawMode] = usePersistState("json-raw-mode", false);
|
|
8
|
+
if (props.data === undefined || props.data === null) {
|
|
9
|
+
return _jsx("div", { className: "text-ui text-neutral-500 italic", children: String(props.data) });
|
|
10
|
+
}
|
|
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)] }));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return inspector;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
widgets?: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
padded?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function Panel(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=Panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,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;CACjB,CAAA;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,2CAcjC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Panel(props) {
|
|
3
|
+
return (_jsxs("div", { className: "bg-black text-white rounded-md shadow-md border border-neutral-800", children: [_jsxs("div", { className: "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 max-h-[calc(100vh-120px)] max-w-[calc(100vw-120px)] flex flex-col ${props.padded ? "p-3" : ""}`, children: props.children })] }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { QueryMonitor } from "../../../../utils/query-monitor";
|
|
2
|
+
type Props = {
|
|
3
|
+
entries?: QueryMonitor.Entry[];
|
|
4
|
+
};
|
|
5
|
+
export declare function QueryMonitorDisplay(props: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=QueryMonitorDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryMonitorDisplay.d.ts","sourceRoot":"","sources":["../../../../../../src/app/lib/devtools/components/ui/QueryMonitorDisplay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAI9D,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,YAAY,CAAC,KAAK,EAAE,CAAA;CAC/B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,kDAS/C"}
|