@qwik.dev/devtools 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin/index.d.ts +4 -1
- package/dist/plugin/index.js +2078 -595
- package/dist/ui/_virtual/browser.qwik.mjs +8 -0
- package/dist/ui/_virtual/browser.qwik2.mjs +4 -0
- package/dist/ui/components/DevtoolsButton/DevtoolsButton.qwik.mjs +1 -1
- package/dist/ui/components/DevtoolsPanel/DevtoolsPanel.qwik.mjs +1 -1
- package/dist/ui/components/Tab/Tab.qwik.mjs +1 -1
- package/dist/ui/components/TabContent/TabContent.qwik.mjs +1 -1
- package/dist/ui/components/ThemeToggle/QwikThemeToggle.qwik.mjs +1 -1
- package/dist/ui/components/Tree/Tree.qwik.mjs +1 -1
- package/dist/ui/devtools.qwik.mjs +73 -72
- package/dist/ui/features/Assets/Assets.qwik.mjs +3 -3
- package/dist/ui/features/CodeBreack/CodeBreack.qwik.mjs +4 -4
- package/dist/ui/features/CodeBreack/HtmlParser.qwik.mjs +13 -20
- package/dist/ui/features/CodeBreack/StateParser.qwik.mjs +13 -20
- package/dist/ui/features/Overview/Overview.qwik.mjs +17 -17
- package/dist/ui/features/Packages/Packages.qwik.mjs +4 -4
- package/dist/ui/features/Packages/components/DependencyCard/DependencyCard.qwik.mjs +9 -9
- package/dist/ui/features/Packages/components/PackageIcon/PackageIcon.qwik.mjs +1 -1
- package/dist/ui/features/Performance/Performance.qwik.mjs +307 -0
- package/dist/ui/features/Performance/computePerfViewModel.qwik.mjs +101 -0
- package/dist/ui/features/Performance/transformPerformanceData.qwik.mjs +34 -0
- package/dist/ui/features/RenderTree/RenderTree.qwik.mjs +38 -45
- package/dist/ui/features/RenderTree/TreeBuilder.qwik.mjs +181 -0
- package/dist/ui/features/RenderTree/data.qwik.mjs +30 -16
- package/dist/ui/features/RenderTree/formatTreeData.qwik.mjs +205 -230
- package/dist/ui/features/RenderTree/types.qwik.mjs +50 -0
- package/dist/ui/features/Routes/Routes.qwik.mjs +3 -3
- package/dist/ui/features/inspect/Inspect.qwik.mjs +1 -1
- package/dist/ui/global.css.qwik.mjs +1 -1
- package/dist/ui/lib-types/kit/src/globals.d.ts +56 -5
- package/dist/ui/lib-types/kit/src/index.d.ts +1 -0
- package/dist/ui/lib-types/kit/src/types.d.ts +9 -0
- package/dist/ui/lib-types/ui/src/features/Performance/Performance.d.ts +1 -0
- package/dist/ui/lib-types/ui/src/features/Performance/computePerfViewModel.d.ts +33 -0
- package/dist/ui/lib-types/ui/src/features/Performance/computePerfViewModel.test.d.ts +1 -0
- package/dist/ui/lib-types/ui/src/features/Performance/transformPerformanceData.d.ts +22 -0
- package/dist/ui/lib-types/ui/src/features/Performance/transformPerformanceData.test.d.ts +1 -0
- package/dist/ui/lib-types/ui/src/features/RenderTree/TreeBuilder.d.ts +60 -0
- package/dist/ui/lib-types/ui/src/features/RenderTree/data.d.ts +34 -8
- package/dist/ui/lib-types/ui/src/features/RenderTree/formatTreeData.d.ts +79 -148
- package/dist/ui/lib-types/ui/src/features/RenderTree/index.d.ts +6 -0
- package/dist/ui/lib-types/ui/src/features/RenderTree/types.d.ts +116 -0
- package/dist/ui/lib-types/ui/src/types/state.d.ts +1 -1
- package/dist/ui/lib-types/ui/src/utils/shiki.d.ts +2 -0
- package/dist/ui/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@7.1.3_@types_node@20.14.11_jiti@2.6._02d306fcbd9f637dd624291702bff9c0/node_modules/@qwikest/icons/lib/hi.qwik.qwik.mjs +19 -0
- package/dist/ui/node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/browser.qwik.mjs +177 -0
- package/dist/ui/node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/common.qwik.mjs +182 -0
- package/dist/ui/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.qwik.mjs +120 -0
- package/dist/ui/packages/kit/src/constants.qwik.mjs +0 -2
- package/dist/ui/packages/kit/src/context.qwik.mjs +5 -4
- package/dist/ui/utils/shiki.qwik.mjs +23 -0
- package/package.json +3 -3
- package/dist/ui/features/RenderTree/transfromqseq.qwik.mjs +0 -91
- package/dist/ui/lib-types/ui/src/features/RenderTree/transfromqseq.d.ts +0 -7
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getDefaultExportFromCjs } from "./_commonjsHelpers.qwik.mjs";
|
|
2
|
+
import { __require as requireBrowser } from "../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/browser.qwik.mjs";
|
|
3
|
+
var browserExports = requireBrowser();
|
|
4
|
+
const debug = /* @__PURE__ */ getDefaultExportFromCjs(browserExports);
|
|
5
|
+
export {
|
|
6
|
+
browserExports as b,
|
|
7
|
+
debug as default
|
|
8
|
+
};
|
|
@@ -76,7 +76,7 @@ const DevtoolsButton = component$(({ state }) => {
|
|
|
76
76
|
return /* @__PURE__ */ jsx("div", {
|
|
77
77
|
ref: elementRef,
|
|
78
78
|
class: {
|
|
79
|
-
"fixed flex h-9 w-9 origin-center select-none items-center justify-center rounded-lg border
|
|
79
|
+
"border-border bg-background fixed flex h-9 w-9 origin-center select-none items-center justify-center rounded-lg border backdrop-blur-md": true,
|
|
80
80
|
"border-accent/50 bg-background/95 shadow-accent/35 rotate-90 shadow-lg": state.isOpen.value && !isDragging.value,
|
|
81
81
|
"cursor-grab": !isDragging.value,
|
|
82
82
|
"cursor-grabbing": isDragging.value,
|
|
@@ -26,7 +26,7 @@ const DevtoolsPanel = component$(({ state }) => {
|
|
|
26
26
|
});
|
|
27
27
|
return /* @__PURE__ */ jsx("div", {
|
|
28
28
|
ref: panelRef,
|
|
29
|
-
class: "fixed bottom-6 right-6 flex h-[calc(100vh-3rem)] w-[calc(100vw-3rem)] translate-y-0 transform overflow-hidden rounded-lg border-2
|
|
29
|
+
class: "border-border bg-background text-foreground fixed bottom-6 right-6 flex h-[calc(100vh-3rem)] w-[calc(100vw-3rem)] translate-y-0 transform overflow-hidden rounded-lg border-2 backdrop-blur-lg transition-transform duration-300 ease-in-out",
|
|
30
30
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
31
31
|
});
|
|
32
32
|
});
|
|
@@ -6,7 +6,7 @@ const Tab = component$(({ state, id, title }) => {
|
|
|
6
6
|
title,
|
|
7
7
|
class: {
|
|
8
8
|
"flex h-10 w-10 items-center justify-center rounded-lg p-2.5 transition-all duration-200": true,
|
|
9
|
-
"
|
|
9
|
+
"hover:bg-foreground/5 text-muted-foreground hover:text-foreground bg-transparent": state.activeTab !== id,
|
|
10
10
|
"shadow-accent/35 bg-accent text-white shadow-lg": state.activeTab === id
|
|
11
11
|
},
|
|
12
12
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
@@ -5,7 +5,7 @@ const TabContent = component$(() => {
|
|
|
5
5
|
class: "flex h-full w-full flex-col space-y-6",
|
|
6
6
|
children: [
|
|
7
7
|
/* @__PURE__ */ jsx("div", {
|
|
8
|
-
class: "flex items-center justify-between border-b
|
|
8
|
+
class: "border-border flex items-center justify-between border-b pb-4",
|
|
9
9
|
children: /* @__PURE__ */ jsx(Slot, {
|
|
10
10
|
name: "title"
|
|
11
11
|
})
|
|
@@ -39,7 +39,7 @@ const QwikThemeToggle = component$(() => {
|
|
|
39
39
|
return /* @__PURE__ */ jsx(Fragment, {
|
|
40
40
|
children: /* @__PURE__ */ jsx("button", {
|
|
41
41
|
onClick$,
|
|
42
|
-
class: "group relative flex h-8 w-8 items-center justify-center rounded-md
|
|
42
|
+
class: "bg-background text-foreground group relative flex h-8 w-8 items-center justify-center rounded-md hover:opacity-60",
|
|
43
43
|
children: /* @__PURE__ */ jsxs("div", {
|
|
44
44
|
class: "absolute inset-0 grid place-items-center transition-transform duration-200 ease-out group-hover:scale-110 group-active:scale-75",
|
|
45
45
|
children: [
|
|
@@ -50,7 +50,7 @@ const TreeNodeComponent = component$((props) => {
|
|
|
50
50
|
class: `inline-flex items-center rounded-md px-2 py-1`,
|
|
51
51
|
children: [
|
|
52
52
|
hasChildren ? /* @__PURE__ */ jsx(HiChevronUpMini, {
|
|
53
|
-
class: `mr-2 h-4 w-4 flex-shrink-0
|
|
53
|
+
class: `text-muted-foreground mr-2 h-4 w-4 flex-shrink-0 transition-transform duration-200 ${isExpanded.value ? "rotate-90" : "rotate-180"}`
|
|
54
54
|
}) : /* @__PURE__ */ jsx("div", {
|
|
55
55
|
class: "mr-2 w-4 flex-shrink-0"
|
|
56
56
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "@qwik.dev/core/jsx-runtime";
|
|
2
2
|
import { component$, useStyles$, useStore, useSignal, useVisibleTask$, noSerialize } from "@qwik.dev/core";
|
|
3
3
|
import { tryCreateHotContext } from "./node_modules/.pnpm/vite-hot-client@2.0.4_vite@7.1.3_@types_node@20.14.11_jiti@2.6.1_lightningcss@1.30.1_tsx@4.19.2_yaml@2.8.1_/node_modules/vite-hot-client/dist/index.qwik.mjs";
|
|
4
|
-
import { HiBoltOutline, HiCubeOutline, HiPhotoOutline, HiMegaphoneMini, HiCodeBracketSolid } from "./node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@7.1.3_@types_node@20.14.11_jiti@2.6._02d306fcbd9f637dd624291702bff9c0/node_modules/@qwikest/icons/lib/hi.qwik.qwik.mjs";
|
|
4
|
+
import { HiBoltOutline, HiCubeOutline, HiPhotoOutline, HiMegaphoneMini, HiCodeBracketSolid, HiClockOutline } from "./node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@7.1.3_@types_node@20.14.11_jiti@2.6._02d306fcbd9f637dd624291702bff9c0/node_modules/@qwikest/icons/lib/hi.qwik.qwik.mjs";
|
|
5
5
|
import { BsDiagram3 } from "./node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@7.1.3_@types_node@20.14.11_jiti@2.6._02d306fcbd9f637dd624291702bff9c0/node_modules/@qwikest/icons/lib/bs.qwik.qwik.mjs";
|
|
6
6
|
import { LuFolderTree } from "./node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@7.1.3_@types_node@20.14.11_jiti@2.6._02d306fcbd9f637dd624291702bff9c0/node_modules/@qwikest/icons/lib/lu.qwik.qwik.mjs";
|
|
7
7
|
import { createClientRpc } from "./packages/kit/src/client.qwik.mjs";
|
|
@@ -24,11 +24,29 @@ import { Inspect } from "./features/inspect/Inspect.qwik.mjs";
|
|
|
24
24
|
import { QwikThemeToggle } from "./components/ThemeToggle/QwikThemeToggle.qwik.mjs";
|
|
25
25
|
import { ThemeScript } from "./components/ThemeToggle/theme-script.qwik.mjs";
|
|
26
26
|
import { CodeBreack } from "./features/CodeBreack/CodeBreack.qwik.mjs";
|
|
27
|
+
import { Performance } from "./features/Performance/Performance.qwik.mjs";
|
|
28
|
+
import { b as browserExports } from "./_virtual/browser.qwik.mjs";
|
|
29
|
+
const log = browserExports.debug("qwik:devtools:devtools");
|
|
27
30
|
function getClientRpcFunctions() {
|
|
28
31
|
return {
|
|
29
32
|
healthCheck: () => true
|
|
30
33
|
};
|
|
31
34
|
}
|
|
35
|
+
function toDevtoolsRoutes(routes) {
|
|
36
|
+
const children = routes?.children || [];
|
|
37
|
+
const directories = children.filter((child) => child.type === re.DIRECTORY);
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
relativePath: "",
|
|
41
|
+
name: "index",
|
|
42
|
+
type: re.DIRECTORY,
|
|
43
|
+
path: "",
|
|
44
|
+
isSymbolicLink: false,
|
|
45
|
+
children: void 0
|
|
46
|
+
},
|
|
47
|
+
...directories
|
|
48
|
+
];
|
|
49
|
+
}
|
|
32
50
|
const QwikDevtools = component$(() => {
|
|
33
51
|
useStyles$(globalCss);
|
|
34
52
|
const state = useStore({
|
|
@@ -41,7 +59,6 @@ const QwikDevtools = component$(() => {
|
|
|
41
59
|
allDependencies: [],
|
|
42
60
|
isLoadingDependencies: false
|
|
43
61
|
});
|
|
44
|
-
const clientReady = useSignal(false);
|
|
45
62
|
useVisibleTask$(async () => {
|
|
46
63
|
const hot = await tryCreateHotContext(void 0, [
|
|
47
64
|
"/"
|
|
@@ -51,78 +68,43 @@ const QwikDevtools = component$(() => {
|
|
|
51
68
|
}
|
|
52
69
|
setViteClientContext(hot);
|
|
53
70
|
createClientRpc(getClientRpcFunctions());
|
|
54
|
-
clientReady.value = true;
|
|
55
|
-
});
|
|
56
|
-
useVisibleTask$(async ({ track }) => {
|
|
57
|
-
track(() => clientReady.value);
|
|
58
|
-
if (!clientReady.value) return;
|
|
59
|
-
const rpc = getViteClientRpc();
|
|
60
|
-
try {
|
|
61
|
-
const assets = await rpc.getAssetsFromPublicDir();
|
|
62
|
-
state.assets = assets;
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.error("Failed to load assets:", error);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
useVisibleTask$(async ({ track }) => {
|
|
68
|
-
track(() => clientReady.value);
|
|
69
|
-
if (!clientReady.value) return;
|
|
70
|
-
const rpc = getViteClientRpc();
|
|
71
|
-
try {
|
|
72
|
-
const components = await rpc.getComponents();
|
|
73
|
-
state.components = components;
|
|
74
|
-
} catch (error) {
|
|
75
|
-
console.error("Failed to load components:", error);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
useVisibleTask$(async ({ track }) => {
|
|
79
|
-
track(() => clientReady.value);
|
|
80
|
-
if (!clientReady.value) return;
|
|
81
|
-
const rpc = getViteClientRpc();
|
|
82
|
-
try {
|
|
83
|
-
const routes = await rpc.getRoutes();
|
|
84
|
-
const children = routes?.children || [];
|
|
85
|
-
const directories = children.filter((child) => child.type === "directory");
|
|
86
|
-
const values = [
|
|
87
|
-
{
|
|
88
|
-
relativePath: "",
|
|
89
|
-
name: "index",
|
|
90
|
-
type: re.DIRECTORY,
|
|
91
|
-
path: "",
|
|
92
|
-
isSymbolicLink: false,
|
|
93
|
-
children: void 0
|
|
94
|
-
},
|
|
95
|
-
...directories
|
|
96
|
-
];
|
|
97
|
-
state.routes = noSerialize(values);
|
|
98
|
-
} catch (error) {
|
|
99
|
-
console.error("Failed to load routes:", error);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
useVisibleTask$(async ({ track }) => {
|
|
103
|
-
track(() => clientReady.value);
|
|
104
|
-
if (!clientReady.value) return;
|
|
105
|
-
const rpc = getViteClientRpc();
|
|
106
|
-
try {
|
|
107
|
-
const qwikPackages = await rpc.getQwikPackages();
|
|
108
|
-
state.npmPackages = qwikPackages;
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.error("Failed to load Qwik packages:", error);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
useVisibleTask$(async ({ track }) => {
|
|
114
|
-
track(() => clientReady.value);
|
|
115
|
-
if (!clientReady.value) return;
|
|
116
71
|
const rpc = getViteClientRpc();
|
|
72
|
+
const group1 = Promise.allSettled([
|
|
73
|
+
rpc.getAssetsFromPublicDir(),
|
|
74
|
+
rpc.getComponents(),
|
|
75
|
+
rpc.getRoutes(),
|
|
76
|
+
rpc.getQwikPackages()
|
|
77
|
+
]);
|
|
117
78
|
state.isLoadingDependencies = true;
|
|
118
|
-
|
|
119
|
-
const allDeps = await rpc.getAllDependencies();
|
|
79
|
+
const depsPromise = rpc.getAllDependencies().then((allDeps) => {
|
|
120
80
|
state.allDependencies = allDeps;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
}
|
|
81
|
+
}).catch((error) => {
|
|
82
|
+
log("Failed to load all dependencies:", error);
|
|
83
|
+
}).finally(() => {
|
|
124
84
|
state.isLoadingDependencies = false;
|
|
85
|
+
});
|
|
86
|
+
const [assetsRes, componentsRes, routesRes, packagesRes] = await group1;
|
|
87
|
+
if (assetsRes.status === "fulfilled") {
|
|
88
|
+
state.assets = assetsRes.value;
|
|
89
|
+
} else {
|
|
90
|
+
log("Failed to load assets:", assetsRes.reason);
|
|
91
|
+
}
|
|
92
|
+
if (componentsRes.status === "fulfilled") {
|
|
93
|
+
state.components = componentsRes.value;
|
|
94
|
+
} else {
|
|
95
|
+
log("Failed to load components:", componentsRes.reason);
|
|
125
96
|
}
|
|
97
|
+
if (routesRes.status === "fulfilled") {
|
|
98
|
+
state.routes = noSerialize(toDevtoolsRoutes(routesRes.value));
|
|
99
|
+
} else {
|
|
100
|
+
log("Failed to load routes:", routesRes.reason);
|
|
101
|
+
}
|
|
102
|
+
if (packagesRes.status === "fulfilled") {
|
|
103
|
+
state.npmPackages = packagesRes.value;
|
|
104
|
+
} else {
|
|
105
|
+
log("Failed to load Qwik packages:", packagesRes.reason);
|
|
106
|
+
}
|
|
107
|
+
await depsPromise;
|
|
126
108
|
});
|
|
127
109
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
128
110
|
children: [
|
|
@@ -136,7 +118,7 @@ const QwikDevtools = component$(() => {
|
|
|
136
118
|
state,
|
|
137
119
|
children: [
|
|
138
120
|
/* @__PURE__ */ jsxs("div", {
|
|
139
|
-
class: "bg-background/95 flex flex-col gap-2 border-r
|
|
121
|
+
class: "bg-background/95 border-border flex flex-col gap-2 border-r p-3",
|
|
140
122
|
children: [
|
|
141
123
|
/* @__PURE__ */ jsx(Tab, {
|
|
142
124
|
state,
|
|
@@ -189,11 +171,19 @@ const QwikDevtools = component$(() => {
|
|
|
189
171
|
/* @__PURE__ */ jsx(Tab, {
|
|
190
172
|
state,
|
|
191
173
|
id: "codeBreack",
|
|
192
|
-
title: "
|
|
174
|
+
title: "CodeBreack",
|
|
193
175
|
children: /* @__PURE__ */ jsx(HiCodeBracketSolid, {
|
|
194
176
|
class: "h-5 w-5"
|
|
195
177
|
})
|
|
196
178
|
}),
|
|
179
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
180
|
+
state,
|
|
181
|
+
id: "performance",
|
|
182
|
+
title: "Performance",
|
|
183
|
+
children: /* @__PURE__ */ jsx(HiClockOutline, {
|
|
184
|
+
class: "h-5 w-5"
|
|
185
|
+
})
|
|
186
|
+
}),
|
|
197
187
|
/* @__PURE__ */ jsx("div", {
|
|
198
188
|
class: "mt-auto",
|
|
199
189
|
children: /* @__PURE__ */ jsx(QwikThemeToggle, {})
|
|
@@ -235,7 +225,7 @@ const QwikDevtools = component$(() => {
|
|
|
235
225
|
"q:slot": "title"
|
|
236
226
|
}),
|
|
237
227
|
/* @__PURE__ */ jsxs("div", {
|
|
238
|
-
class: "flex gap-4 text-sm
|
|
228
|
+
class: "text-muted-foreground flex gap-4 text-sm",
|
|
239
229
|
children: [
|
|
240
230
|
/* @__PURE__ */ jsxs("span", {
|
|
241
231
|
children: [
|
|
@@ -310,6 +300,17 @@ const QwikDevtools = component$(() => {
|
|
|
310
300
|
"q:slot": "content"
|
|
311
301
|
})
|
|
312
302
|
]
|
|
303
|
+
}),
|
|
304
|
+
state.activeTab === "performance" && /* @__PURE__ */ jsxs(TabContent, {
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ jsx(TabTitle, {
|
|
307
|
+
title: "performance",
|
|
308
|
+
"q:slot": "title"
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ jsx(Performance, {
|
|
311
|
+
"q:slot": "content"
|
|
312
|
+
})
|
|
313
|
+
]
|
|
313
314
|
})
|
|
314
315
|
]
|
|
315
316
|
})
|
|
@@ -7,7 +7,7 @@ const Assets = component$(({ state }) => {
|
|
|
7
7
|
const isImage = asset.path.match(/\.(jpg|jpeg|png|gif|svg|webp)$/i);
|
|
8
8
|
const fileExt = asset.path.split(".").pop()?.toUpperCase();
|
|
9
9
|
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
-
class: "
|
|
10
|
+
class: "border-border bg-card-item-bg hover:bg-card-item-hover-bg overflow-hidden rounded-xl border transition-all duration-200",
|
|
11
11
|
children: [
|
|
12
12
|
isImage ? /* @__PURE__ */ jsx("div", {
|
|
13
13
|
class: "aspect-square overflow-hidden bg-black/20",
|
|
@@ -21,7 +21,7 @@ const Assets = component$(({ state }) => {
|
|
|
21
21
|
}) : /* @__PURE__ */ jsx("div", {
|
|
22
22
|
class: "flex aspect-square items-center justify-center bg-black/20",
|
|
23
23
|
children: /* @__PURE__ */ jsx("span", {
|
|
24
|
-
class: "font-mono text-2xl
|
|
24
|
+
class: "text-muted-foreground font-mono text-2xl",
|
|
25
25
|
children: fileExt
|
|
26
26
|
})
|
|
27
27
|
}),
|
|
@@ -34,7 +34,7 @@ const Assets = component$(({ state }) => {
|
|
|
34
34
|
children: asset.path.split("/").pop()
|
|
35
35
|
}),
|
|
36
36
|
/* @__PURE__ */ jsxs("div", {
|
|
37
|
-
class: "flex items-center justify-between text-xs
|
|
37
|
+
class: "text-muted-foreground flex items-center justify-between text-xs",
|
|
38
38
|
children: [
|
|
39
39
|
/* @__PURE__ */ jsxs("span", {
|
|
40
40
|
children: [
|
|
@@ -19,17 +19,17 @@ const CodeBreack = component$(() => {
|
|
|
19
19
|
`);
|
|
20
20
|
const currentTab = useSignal("state");
|
|
21
21
|
return /* @__PURE__ */ jsxs("div", {
|
|
22
|
-
class: "space-y-6
|
|
22
|
+
class: "h-full space-y-6 overflow-hidden",
|
|
23
23
|
children: [
|
|
24
24
|
/* @__PURE__ */ jsx("div", {
|
|
25
25
|
class: "flex justify-center",
|
|
26
26
|
children: /* @__PURE__ */ jsxs("div", {
|
|
27
|
-
class: "inline-flex rounded-xl border
|
|
27
|
+
class: "border-border bg-background inline-flex rounded-xl border p-0.5",
|
|
28
28
|
children: [
|
|
29
29
|
/* @__PURE__ */ jsx("button", {
|
|
30
30
|
onClick$: () => currentTab.value = "state",
|
|
31
31
|
class: {
|
|
32
|
-
"
|
|
32
|
+
"rounded-lg px-3 py-2 text-sm font-medium transition-colors md:px-4": true,
|
|
33
33
|
"bg-accent text-white shadow": currentTab.value === "state",
|
|
34
34
|
"text-muted-foreground hover:bg-foreground/5": currentTab.value !== "state"
|
|
35
35
|
},
|
|
@@ -38,7 +38,7 @@ const CodeBreack = component$(() => {
|
|
|
38
38
|
/* @__PURE__ */ jsx("button", {
|
|
39
39
|
onClick$: () => currentTab.value = "html",
|
|
40
40
|
class: {
|
|
41
|
-
"
|
|
41
|
+
"rounded-lg px-3 py-2 text-sm font-medium transition-colors md:px-4": true,
|
|
42
42
|
"bg-accent text-white shadow": currentTab.value === "html",
|
|
43
43
|
"text-muted-foreground hover:bg-foreground/5": currentTab.value !== "html"
|
|
44
44
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@qwik.dev/core/jsx-runtime";
|
|
2
2
|
import { component$, useStyles$, useSignal, $, useVisibleTask$ } from "@qwik.dev/core";
|
|
3
3
|
import { _getDomContainer, _vnode_toString } from "@qwik.dev/core/internal";
|
|
4
|
-
import {
|
|
4
|
+
import { getHighlighter } from "../../utils/shiki.qwik.mjs";
|
|
5
5
|
const HtmlParser = component$(() => {
|
|
6
6
|
useStyles$(`
|
|
7
7
|
pre.shiki { overflow: auto; padding: 10px; height: 100%; }
|
|
@@ -62,14 +62,7 @@ ${inputHtml.value}`;
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
if (!shikiRef.value) {
|
|
65
|
-
shikiRef.value = await
|
|
66
|
-
themes: [
|
|
67
|
-
"nord"
|
|
68
|
-
],
|
|
69
|
-
langs: [
|
|
70
|
-
"html"
|
|
71
|
-
]
|
|
72
|
-
});
|
|
65
|
+
shikiRef.value = await getHighlighter();
|
|
73
66
|
}
|
|
74
67
|
highlightedHtml.value = shikiRef.value.codeToHtml(htmlResult.value, {
|
|
75
68
|
lang: "html",
|
|
@@ -80,17 +73,17 @@ ${inputHtml.value}`;
|
|
|
80
73
|
class: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
81
74
|
children: [
|
|
82
75
|
/* @__PURE__ */ jsxs("div", {
|
|
83
|
-
class: "
|
|
76
|
+
class: "border-border bg-card-item-bg flex h-[60vh] min-h-0 flex-col rounded-xl border",
|
|
84
77
|
children: [
|
|
85
78
|
/* @__PURE__ */ jsxs("div", {
|
|
86
|
-
class: "flex items-center justify-between border-b
|
|
79
|
+
class: "border-border flex items-center justify-between border-b p-3",
|
|
87
80
|
children: [
|
|
88
81
|
/* @__PURE__ */ jsx("div", {
|
|
89
82
|
class: "text-sm font-medium",
|
|
90
83
|
children: "Input HTML"
|
|
91
84
|
}),
|
|
92
85
|
parsingTime.value !== null && /* @__PURE__ */ jsxs("span", {
|
|
93
|
-
class: "rounded-full border
|
|
86
|
+
class: "border-border text-muted-foreground rounded-full border px-2 py-0.5 text-xs",
|
|
94
87
|
children: [
|
|
95
88
|
parsingTime.value,
|
|
96
89
|
"ms"
|
|
@@ -99,19 +92,19 @@ ${inputHtml.value}`;
|
|
|
99
92
|
]
|
|
100
93
|
}),
|
|
101
94
|
/* @__PURE__ */ jsxs("div", {
|
|
102
|
-
class: "
|
|
95
|
+
class: "min-h-0 flex-1 flex-col space-y-3 p-3",
|
|
103
96
|
children: [
|
|
104
97
|
/* @__PURE__ */ jsx("textarea", {
|
|
105
98
|
value: inputHtml.value,
|
|
106
99
|
onInput$: (e, t) => inputHtml.value = t.value,
|
|
107
100
|
placeholder: "Paste HTML and click to parse/format.",
|
|
108
|
-
class: "h-full min-h-0 w-full flex-1 resize-none rounded-md border
|
|
101
|
+
class: "border-border bg-background h-full min-h-0 w-full flex-1 resize-none rounded-md border p-3 font-mono text-sm"
|
|
109
102
|
}),
|
|
110
103
|
/* @__PURE__ */ jsx("div", {
|
|
111
104
|
class: "flex items-center gap-3",
|
|
112
105
|
children: /* @__PURE__ */ jsx("button", {
|
|
113
106
|
onClick$: onParseHtml$,
|
|
114
|
-
class: "bg-accent
|
|
107
|
+
class: "bg-accent rounded-md px-3 py-1.5 text-sm text-white hover:opacity-90",
|
|
115
108
|
children: "Parse HTML"
|
|
116
109
|
})
|
|
117
110
|
})
|
|
@@ -120,17 +113,17 @@ ${inputHtml.value}`;
|
|
|
120
113
|
]
|
|
121
114
|
}),
|
|
122
115
|
/* @__PURE__ */ jsxs("div", {
|
|
123
|
-
class: "
|
|
116
|
+
class: "border-border bg-card-item-bg flex h-[60vh] min-h-0 flex-col overflow-hidden rounded-xl border",
|
|
124
117
|
children: [
|
|
125
118
|
/* @__PURE__ */ jsxs("div", {
|
|
126
|
-
class: "flex items-center justify-between border-b
|
|
119
|
+
class: "border-border flex items-center justify-between border-b p-3",
|
|
127
120
|
children: [
|
|
128
121
|
/* @__PURE__ */ jsx("div", {
|
|
129
122
|
class: "text-sm font-medium",
|
|
130
123
|
children: "VNode Tree"
|
|
131
124
|
}),
|
|
132
125
|
parsingTime.value !== null && /* @__PURE__ */ jsxs("span", {
|
|
133
|
-
class: "rounded-full border
|
|
126
|
+
class: "border-border text-muted-foreground rounded-full border px-2 py-0.5 text-xs",
|
|
134
127
|
children: [
|
|
135
128
|
parsingTime.value,
|
|
136
129
|
"ms"
|
|
@@ -139,9 +132,9 @@ ${inputHtml.value}`;
|
|
|
139
132
|
]
|
|
140
133
|
}),
|
|
141
134
|
/* @__PURE__ */ jsx("div", {
|
|
142
|
-
class: "
|
|
135
|
+
class: "h-full min-h-0 flex-1",
|
|
143
136
|
children: /* @__PURE__ */ jsx("pre", {
|
|
144
|
-
class: "overflow-auto
|
|
137
|
+
class: "h-full overflow-auto",
|
|
145
138
|
dangerouslySetInnerHTML: highlightedHtml.value || ""
|
|
146
139
|
})
|
|
147
140
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@qwik.dev/core/jsx-runtime";
|
|
2
2
|
import { component$, useStyles$, useSignal, $, useVisibleTask$ } from "@qwik.dev/core";
|
|
3
3
|
import { _preprocessState, _dumpState } from "@qwik.dev/core/internal";
|
|
4
|
-
import {
|
|
4
|
+
import { getHighlighter } from "../../utils/shiki.qwik.mjs";
|
|
5
5
|
const StateParser = component$(() => {
|
|
6
6
|
useStyles$(`
|
|
7
7
|
pre.shiki { overflow: auto; padding: 10px; height: 100%; }
|
|
@@ -75,14 +75,7 @@ ${inputState.value}`;
|
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
if (!shikiRef.value) {
|
|
78
|
-
shikiRef.value = await
|
|
79
|
-
themes: [
|
|
80
|
-
"nord"
|
|
81
|
-
],
|
|
82
|
-
langs: [
|
|
83
|
-
"json"
|
|
84
|
-
]
|
|
85
|
-
});
|
|
78
|
+
shikiRef.value = await getHighlighter();
|
|
86
79
|
}
|
|
87
80
|
highlightedState.value = shikiRef.value.codeToHtml(stateResult.value, {
|
|
88
81
|
lang: "json",
|
|
@@ -93,17 +86,17 @@ ${inputState.value}`;
|
|
|
93
86
|
class: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
94
87
|
children: [
|
|
95
88
|
/* @__PURE__ */ jsxs("div", {
|
|
96
|
-
class: "
|
|
89
|
+
class: "border-border bg-card-item-bg flex h-[60vh] min-h-0 flex-col rounded-xl border",
|
|
97
90
|
children: [
|
|
98
91
|
/* @__PURE__ */ jsxs("div", {
|
|
99
|
-
class: "flex items-center justify-between border-b
|
|
92
|
+
class: "border-border flex items-center justify-between border-b p-3",
|
|
100
93
|
children: [
|
|
101
94
|
/* @__PURE__ */ jsx("div", {
|
|
102
95
|
class: "text-sm font-medium",
|
|
103
96
|
children: "Input State"
|
|
104
97
|
}),
|
|
105
98
|
parsingTime.value !== null && /* @__PURE__ */ jsxs("span", {
|
|
106
|
-
class: "rounded-full border
|
|
99
|
+
class: "border-border text-muted-foreground rounded-full border px-2 py-0.5 text-xs",
|
|
107
100
|
children: [
|
|
108
101
|
parsingTime.value,
|
|
109
102
|
"ms"
|
|
@@ -112,19 +105,19 @@ ${inputState.value}`;
|
|
|
112
105
|
]
|
|
113
106
|
}),
|
|
114
107
|
/* @__PURE__ */ jsxs("div", {
|
|
115
|
-
class: "
|
|
108
|
+
class: "min-h-0 flex-1 flex-col space-y-3 p-3",
|
|
116
109
|
children: [
|
|
117
110
|
/* @__PURE__ */ jsx("textarea", {
|
|
118
111
|
value: inputState.value,
|
|
119
112
|
onInput$: (e, t) => inputState.value = t.value,
|
|
120
113
|
placeholder: "Paste Qwik state and click to parse/format.",
|
|
121
|
-
class: "h-full min-h-0 w-full flex-1 resize-none rounded-md border
|
|
114
|
+
class: "border-border bg-background h-full min-h-0 w-full flex-1 resize-none rounded-md border p-3 font-mono text-sm"
|
|
122
115
|
}),
|
|
123
116
|
/* @__PURE__ */ jsx("div", {
|
|
124
117
|
class: "flex items-center gap-3",
|
|
125
118
|
children: /* @__PURE__ */ jsx("button", {
|
|
126
119
|
onClick$: onParseState$,
|
|
127
|
-
class: "bg-accent
|
|
120
|
+
class: "bg-accent rounded-md px-3 py-1.5 text-sm text-white hover:opacity-90",
|
|
128
121
|
children: "Parse State"
|
|
129
122
|
})
|
|
130
123
|
})
|
|
@@ -133,17 +126,17 @@ ${inputState.value}`;
|
|
|
133
126
|
]
|
|
134
127
|
}),
|
|
135
128
|
/* @__PURE__ */ jsxs("div", {
|
|
136
|
-
class: "
|
|
129
|
+
class: "border-border bg-card-item-bg flex h-[60vh] min-h-0 flex-col overflow-hidden rounded-xl border",
|
|
137
130
|
children: [
|
|
138
131
|
/* @__PURE__ */ jsxs("div", {
|
|
139
|
-
class: "flex items-center justify-between border-b
|
|
132
|
+
class: "border-border flex items-center justify-between border-b p-3",
|
|
140
133
|
children: [
|
|
141
134
|
/* @__PURE__ */ jsx("div", {
|
|
142
135
|
class: "text-sm font-medium",
|
|
143
136
|
children: "Parsed State"
|
|
144
137
|
}),
|
|
145
138
|
parsingTime.value !== null && /* @__PURE__ */ jsxs("span", {
|
|
146
|
-
class: "rounded-full border
|
|
139
|
+
class: "border-border text-muted-foreground rounded-full border px-2 py-0.5 text-xs",
|
|
147
140
|
children: [
|
|
148
141
|
parsingTime.value,
|
|
149
142
|
"ms"
|
|
@@ -152,9 +145,9 @@ ${inputState.value}`;
|
|
|
152
145
|
]
|
|
153
146
|
}),
|
|
154
147
|
/* @__PURE__ */ jsx("div", {
|
|
155
|
-
class: "
|
|
148
|
+
class: "h-full min-h-0 flex-1",
|
|
156
149
|
children: /* @__PURE__ */ jsx("pre", {
|
|
157
|
-
class: "overflow-auto
|
|
150
|
+
class: "h-full overflow-auto",
|
|
158
151
|
dangerouslySetInnerHTML: highlightedState.value || ""
|
|
159
152
|
})
|
|
160
153
|
})
|