@plitzi/sdk-dev-tools 0.30.19
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/CHANGELOG.md +1406 -0
- package/dist/DevToolsContainer.d.ts +13 -0
- package/dist/DevToolsContainer.mjs +34 -0
- package/dist/DevToolsContextProvider.d.ts +6 -0
- package/dist/DevToolsContextProvider.mjs +46 -0
- package/dist/components/DevToolsPanel/DevToolsBody.d.ts +9 -0
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +35 -0
- package/dist/components/DevToolsPanel/DevToolsButton.d.ts +10 -0
- package/dist/components/DevToolsPanel/DevToolsButton.mjs +14 -0
- package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +10 -0
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +62 -0
- package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +10 -0
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +48 -0
- package/dist/components/DevToolsPanel/DevToolsSubHeader.d.ts +10 -0
- package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +62 -0
- package/dist/components/DevToolsPanel/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/DataSourceViewer.d.ts +5 -0
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/DataSourceViewer.mjs +30 -0
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsAttributes.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsAttributes.mjs +19 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsDefinition.d.ts +7 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsDefinition.mjs +20 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +31 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.mjs +21 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.mjs +35 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsListItem.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsListItem.mjs +24 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.d.ts +7 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.mjs +25 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/Log.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/Logs/Log.mjs +24 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogStatus.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogStatus.mjs +30 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogStatusIcon.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogStatusIcon.mjs +24 -0
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.mjs +61 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummary.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummary.mjs +47 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummaryItem.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummaryItem.mjs +35 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.mjs +38 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +109 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +45 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTreeNode.d.ts +13 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTreeNode.mjs +40 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/InteractionNode.d.ts +14 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/InteractionNode.mjs +32 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeHeader.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeHeader.mjs +49 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeMetadata.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeMetadata.mjs +20 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeWhen.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeWhen.mjs +19 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +56 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.d.ts +12 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.mjs +26 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.mjs +27 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigation.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigation.mjs +36 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +74 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationHeader.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationHeader.mjs +42 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStore.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStore.mjs +30 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreBody.d.ts +26 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreBody.mjs +113 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreHeader.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreHeader.mjs +27 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/buildDiff.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/buildDiff.mjs +20 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/buildHunks.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/buildHunks.mjs +14 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/buildSections.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/buildSections.mjs +30 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/serialize.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/helpers/serialize.mjs +12 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/Logs/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.mjs +59 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.d.ts +5 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.mjs +46 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/index.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/index.mjs +6 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariableValue.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariableValue.mjs +27 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesList.d.ts +7 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesList.mjs +25 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesListItem.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesListItem.mjs +29 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesStyleList.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesStyleList.mjs +38 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.mjs +33 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/index.mjs +5 -0
- package/dist/components/List/List.d.ts +14 -0
- package/dist/components/List/List.mjs +35 -0
- package/dist/components/List/ListItem.d.ts +11 -0
- package/dist/components/List/ListItem.mjs +21 -0
- package/dist/components/List/index.d.ts +6 -0
- package/dist/components/List/index.mjs +6 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +3 -0
- package/package.json +357 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DevToolsPanel/tabs/ElementsViewer/ElementsListItem.tsx
|
|
5
|
+
var i = ({ name: i, id: a, isSelected: o, isVisible: s = !0, onSelect: c }) => {
|
|
6
|
+
let l = t(() => c?.(a), [c, a]);
|
|
7
|
+
return /* @__PURE__ */ r("div", {
|
|
8
|
+
className: e("flex w-full cursor-pointer items-center justify-between gap-2 border-l-2 px-2 py-1.5 transition-colors", {
|
|
9
|
+
"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300": o,
|
|
10
|
+
"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:border-l-transparent dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100": !o
|
|
11
|
+
}),
|
|
12
|
+
onClick: l,
|
|
13
|
+
children: [/* @__PURE__ */ n("div", {
|
|
14
|
+
className: "truncate",
|
|
15
|
+
title: i,
|
|
16
|
+
children: i
|
|
17
|
+
}), /* @__PURE__ */ n("i", { className: e("shrink-0 text-[10px]", {
|
|
18
|
+
"fa-solid fa-eye text-zinc-400 dark:text-zinc-500": s,
|
|
19
|
+
"fa-solid fa-eye-slash text-zinc-300 dark:text-zinc-700": !s
|
|
20
|
+
}) })]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type ElementsViewerProps = {
|
|
2
|
+
className?: string;
|
|
3
|
+
elementSelected?: string;
|
|
4
|
+
onSelectElement: (id?: string) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const ElementsViewer: ({ className, elementSelected, onSelectElement }: ElementsViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ElementsViewer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import e from "./ElementDetails.mjs";
|
|
2
|
+
import t from "./ElementsList.mjs";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { use as r, useCallback as i, useMemo as a } from "react";
|
|
5
|
+
import o from "@plitzi/sdk-navigation/NavigationContext";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { createStoreHook as l } from "@plitzi/sdk-store/createStore";
|
|
8
|
+
//#region src/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.tsx
|
|
9
|
+
var u = ({ className: u, elementSelected: d, onSelectElement: f }) => {
|
|
10
|
+
let { currentPageId: p } = r(o), { useStore: m } = l(), [h] = m("schema.flat"), g = a(() => Object.values(h).filter((e) => e.definition.rootId === p), [h, p]), _ = a(() => g.find((e) => e.id === d), [g, d]), v = i((e) => f(e), [f]);
|
|
11
|
+
return /* @__PURE__ */ c("div", {
|
|
12
|
+
className: n("flex h-full w-full", u),
|
|
13
|
+
children: [/* @__PURE__ */ s(t, {
|
|
14
|
+
elements: g,
|
|
15
|
+
elementSelected: d,
|
|
16
|
+
onSelect: v
|
|
17
|
+
}), d && /* @__PURE__ */ s(e, {
|
|
18
|
+
definition: _?.definition,
|
|
19
|
+
attributes: _?.attributes,
|
|
20
|
+
onSelectElement: f
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { u as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LogParams } from '@plitzi/sdk-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type LogProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
category: string;
|
|
6
|
+
time?: string;
|
|
7
|
+
message?: ReactNode;
|
|
8
|
+
params: LogParams;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('react').MemoExoticComponent<({ category, message, time, params }: LogProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "./categories/LogInteraction/index.mjs";
|
|
2
|
+
import t from "./categories/LogNavigation/index.mjs";
|
|
3
|
+
import n from "./categories/LogStore/LogStore.mjs";
|
|
4
|
+
import { memo as r } from "react";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
var s = r(({ category: r, message: s, time: c, params: l }) => /* @__PURE__ */ o(i, { children: [
|
|
7
|
+
r === "interactions" && /* @__PURE__ */ a(e, {
|
|
8
|
+
message: s,
|
|
9
|
+
params: l,
|
|
10
|
+
time: c
|
|
11
|
+
}),
|
|
12
|
+
r === "navigation" && /* @__PURE__ */ a(t, {
|
|
13
|
+
message: s,
|
|
14
|
+
params: l,
|
|
15
|
+
time: c
|
|
16
|
+
}),
|
|
17
|
+
r === "store" && /* @__PURE__ */ a(n, {
|
|
18
|
+
message: s,
|
|
19
|
+
params: l,
|
|
20
|
+
time: c
|
|
21
|
+
})
|
|
22
|
+
] }));
|
|
23
|
+
//#endregion
|
|
24
|
+
export { s as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LogType } from '@plitzi/sdk-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type LogStatusProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
iconClassName?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
logType: LogType | 'custom';
|
|
8
|
+
};
|
|
9
|
+
declare const LogStatus: ({ className, logType, iconClassName, children }: LogStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default LogStatus;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/DevToolsPanel/tabs/Logs/LogStatus.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
danger: "fa-regular fa-circle-xmark",
|
|
6
|
+
warning: "fa-solid fa-triangle-exclamation",
|
|
7
|
+
info: "fa-solid fa-circle-info",
|
|
8
|
+
success: "fa-solid fa-check"
|
|
9
|
+
}, i = {
|
|
10
|
+
danger: "Error",
|
|
11
|
+
warning: "Warning",
|
|
12
|
+
info: "Info",
|
|
13
|
+
success: "Success"
|
|
14
|
+
}, a = ({ className: a, logType: o = "info", iconClassName: s, children: c }) => /* @__PURE__ */ n("div", {
|
|
15
|
+
className: e("flex items-center gap-1 rounded px-1.5 py-0.5 font-medium", {
|
|
16
|
+
"bg-red-50 text-red-600 dark:bg-red-500/15 dark:text-red-400": o === "danger",
|
|
17
|
+
"bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400": o === "warning",
|
|
18
|
+
"bg-violet-50 text-violet-700 dark:bg-violet-500/15 dark:text-violet-400": o === "info",
|
|
19
|
+
"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400": o === "success",
|
|
20
|
+
"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300": ![
|
|
21
|
+
"danger",
|
|
22
|
+
"warning",
|
|
23
|
+
"info",
|
|
24
|
+
"success"
|
|
25
|
+
].includes(o)
|
|
26
|
+
}, a),
|
|
27
|
+
children: [/* @__PURE__ */ t("i", { className: e(s ?? r[o], "text-[10px]") }), c ?? i[o]]
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { a as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LogType } from '@plitzi/sdk-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type LogStatusIconProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
iconClassName?: string;
|
|
7
|
+
logType: LogType | 'custom';
|
|
8
|
+
title?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const LogStatusIcon: ({ className, logType, iconClassName, title, children }: LogStatusIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default LogStatusIcon;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/DevToolsPanel/tabs/Logs/LogStatusIcon.tsx
|
|
4
|
+
var r = ({ className: r, logType: i = "info", iconClassName: a, title: o, children: s }) => {
|
|
5
|
+
let c = i === "danger" ? "fa-regular fa-circle-xmark" : i === "warning" ? "fa-solid fa-triangle-exclamation" : i === "info" ? "fa-solid fa-circle-info" : i === "success" ? "fa-solid fa-check" : "fa-solid fa-circle";
|
|
6
|
+
return /* @__PURE__ */ n("div", {
|
|
7
|
+
className: e("flex items-center gap-1", r),
|
|
8
|
+
title: o,
|
|
9
|
+
children: [/* @__PURE__ */ t("i", { className: e(a ?? c, {
|
|
10
|
+
"text-red-500 dark:text-red-400": i === "danger",
|
|
11
|
+
"text-amber-500 dark:text-amber-400": i === "warning",
|
|
12
|
+
"text-violet-500 dark:text-violet-400": i === "info",
|
|
13
|
+
"text-emerald-500 dark:text-emerald-400": i === "success",
|
|
14
|
+
"text-zinc-500 dark:text-zinc-400": ![
|
|
15
|
+
"danger",
|
|
16
|
+
"warning",
|
|
17
|
+
"info",
|
|
18
|
+
"success"
|
|
19
|
+
].includes(i)
|
|
20
|
+
}, "text-xs") }), s]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Orientation } from '../../../../DevToolsContainer';
|
|
2
|
+
import { Log as TLog } from '@plitzi/sdk-shared';
|
|
3
|
+
export type LogsProps = {
|
|
4
|
+
items: TLog[];
|
|
5
|
+
autoScrollOffset?: number;
|
|
6
|
+
orientation: Orientation;
|
|
7
|
+
onClear?: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const Logs: ({ items, autoScrollOffset, orientation, onClear }: LogsProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Logs;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import e from "./Log.mjs";
|
|
2
|
+
import t from "./LogsSummary/index.mjs";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/DevToolsPanel/tabs/Logs/Logs.tsx
|
|
7
|
+
var l = ({ items: l = [], autoScrollOffset: u = 40, orientation: d = "horizontal", onClear: f }) => {
|
|
8
|
+
let [p, m] = o(), h = a(null), g = a(!0);
|
|
9
|
+
i(() => {
|
|
10
|
+
let e = h.current;
|
|
11
|
+
e && g.current && (e.scrollTop = e.scrollHeight);
|
|
12
|
+
}, [l]);
|
|
13
|
+
let _ = r(() => {
|
|
14
|
+
let e = h.current;
|
|
15
|
+
e && (g.current = e.scrollHeight - e.scrollTop - e.clientHeight <= u);
|
|
16
|
+
}, [u]), v = r((e) => {
|
|
17
|
+
m(e);
|
|
18
|
+
}, []);
|
|
19
|
+
return /* @__PURE__ */ c("div", {
|
|
20
|
+
className: "flex h-full w-full flex-col",
|
|
21
|
+
children: [/* @__PURE__ */ c("div", {
|
|
22
|
+
className: "flex shrink-0 items-center justify-between border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800",
|
|
23
|
+
children: [/* @__PURE__ */ c("span", {
|
|
24
|
+
className: "font-mono text-zinc-400 dark:text-zinc-500",
|
|
25
|
+
children: [
|
|
26
|
+
l.length,
|
|
27
|
+
" ",
|
|
28
|
+
l.length === 1 ? "entry" : "entries"
|
|
29
|
+
]
|
|
30
|
+
}), /* @__PURE__ */ c("button", {
|
|
31
|
+
className: "rounded px-2 py-0.5 text-xs text-zinc-500 transition-colors hover:bg-zinc-200 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-200",
|
|
32
|
+
onClick: f,
|
|
33
|
+
children: [/* @__PURE__ */ s("i", { className: "fa-solid fa-trash-can mr-1" }), "Clear"]
|
|
34
|
+
})]
|
|
35
|
+
}), /* @__PURE__ */ c("div", {
|
|
36
|
+
className: n("flex h-full w-full overflow-hidden", { "grow basis-0 flex-col": d === "vertical" }),
|
|
37
|
+
children: [/* @__PURE__ */ s(t, {
|
|
38
|
+
className: n({ "h-full": d === "horizontal" }),
|
|
39
|
+
logTypeSelected: p,
|
|
40
|
+
items: l,
|
|
41
|
+
orientation: d,
|
|
42
|
+
onClick: v
|
|
43
|
+
}), /* @__PURE__ */ s("div", {
|
|
44
|
+
ref: h,
|
|
45
|
+
onScroll: _,
|
|
46
|
+
className: "flex grow basis-0 flex-col overflow-y-auto",
|
|
47
|
+
children: l.length === 0 ? /* @__PURE__ */ c("div", {
|
|
48
|
+
className: "flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",
|
|
49
|
+
children: [/* @__PURE__ */ s("i", { className: "fa-solid fa-terminal text-3xl opacity-20" }), /* @__PURE__ */ s("span", { children: "No logs yet" })]
|
|
50
|
+
}) : l.filter((e) => !p || e.logType === p).map((t, n) => /* @__PURE__ */ s(e, {
|
|
51
|
+
category: t.category,
|
|
52
|
+
time: t.time,
|
|
53
|
+
params: t.params,
|
|
54
|
+
message: t.message
|
|
55
|
+
}, n))
|
|
56
|
+
})]
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { l as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Orientation } from '../../../../../DevToolsContainer';
|
|
2
|
+
import { Log, LogType } from '@plitzi/sdk-shared';
|
|
3
|
+
export type LogsSummaryProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
items: Log[];
|
|
6
|
+
logTypeSelected?: LogType;
|
|
7
|
+
orientation: Orientation;
|
|
8
|
+
onClick?: (logType?: LogType) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const LogsSummary: ({ className, orientation, items, logTypeSelected, onClick }: LogsSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default LogsSummary;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import e from "./LogsSummaryItem.mjs";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { useCallback as n, useMemo as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummary.tsx
|
|
6
|
+
var o = ({ className: o, orientation: s = "horizontal", items: c, logTypeSelected: l, onClick: u }) => {
|
|
7
|
+
let d = r(() => c.reduce((e, t) => {
|
|
8
|
+
let { logType: n } = t;
|
|
9
|
+
return e[n] || (e[n] = 0), {
|
|
10
|
+
...e,
|
|
11
|
+
[n]: ++e[n]
|
|
12
|
+
};
|
|
13
|
+
}, {}), [c]), f = n((e) => u?.(e), [u]);
|
|
14
|
+
return /* @__PURE__ */ a("div", {
|
|
15
|
+
className: t("flex shrink-0 border-zinc-200 select-none dark:border-zinc-700", s === "horizontal" ? "flex-col border-r" : "border-b", o),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ i(e, {
|
|
18
|
+
onClick: f,
|
|
19
|
+
amount: c.length,
|
|
20
|
+
selected: !l
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ i(e, {
|
|
23
|
+
onClick: f,
|
|
24
|
+
amount: d.danger ?? 0,
|
|
25
|
+
suffix: "Errors",
|
|
26
|
+
logType: "danger",
|
|
27
|
+
selected: l === "danger"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ i(e, {
|
|
30
|
+
onClick: f,
|
|
31
|
+
amount: d.warning ?? 0,
|
|
32
|
+
suffix: "Warnings",
|
|
33
|
+
logType: "warning",
|
|
34
|
+
selected: l === "warning"
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ i(e, {
|
|
37
|
+
onClick: f,
|
|
38
|
+
amount: d.info ?? 0,
|
|
39
|
+
suffix: "Info",
|
|
40
|
+
logType: "info",
|
|
41
|
+
selected: l === "info"
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { o as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LogType } from '@plitzi/sdk-shared';
|
|
2
|
+
export type LogsSummaryItemProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
amount: number;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
logType?: LogType;
|
|
7
|
+
suffix?: string;
|
|
8
|
+
onClick?: (logType?: LogType) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const LogsSummaryItem: ({ className, amount, suffix, selected, logType, onClick }: LogsSummaryItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default LogsSummaryItem;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummaryItem.tsx
|
|
5
|
+
var i = ({ className: i, amount: a, suffix: o = "All", selected: s, logType: c, onClick: l }) => {
|
|
6
|
+
let u = t(() => l?.(c), [l, c]);
|
|
7
|
+
return /* @__PURE__ */ r("div", {
|
|
8
|
+
className: e("flex cursor-pointer items-center gap-2 px-2 py-1.5 transition-colors", s ? "bg-zinc-200 dark:bg-zinc-700" : "hover:bg-zinc-100 dark:hover:bg-zinc-800", i),
|
|
9
|
+
onClick: u,
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ n("i", { className: e("text-xs", {
|
|
12
|
+
"fa-regular fa-circle-xmark text-red-500 dark:text-red-400": c === "danger",
|
|
13
|
+
"fa-solid fa-triangle-exclamation text-amber-500 dark:text-amber-400": c === "warning",
|
|
14
|
+
"fa-solid fa-circle-info text-violet-500 dark:text-violet-400": c === "info",
|
|
15
|
+
"fa-solid fa-check text-emerald-500 dark:text-emerald-400": c === "success",
|
|
16
|
+
"fa-solid fa-list text-zinc-500 dark:text-zinc-400": !c || ![
|
|
17
|
+
"danger",
|
|
18
|
+
"warning",
|
|
19
|
+
"info",
|
|
20
|
+
"success"
|
|
21
|
+
].includes(c)
|
|
22
|
+
}) }),
|
|
23
|
+
/* @__PURE__ */ n("span", {
|
|
24
|
+
className: "font-medium text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
25
|
+
children: a
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ n("span", {
|
|
28
|
+
className: "text-xs text-zinc-400 dark:text-zinc-500",
|
|
29
|
+
children: o
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { i as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LogInteraction } from '@plitzi/sdk-shared';
|
|
2
|
+
export type BodyContentProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
node: LogInteraction['params']['node'];
|
|
5
|
+
nodes: LogInteraction['params']['nodes'];
|
|
6
|
+
};
|
|
7
|
+
declare const BodyContent: ({ className, node, nodes }: BodyContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default BodyContent;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import e from "./ExecutionTree/index.mjs";
|
|
2
|
+
import t from "./InteractionNode/index.mjs";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { useCallback as r, useMemo as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { get as c } from "@plitzi/plitzi-ui/helpers";
|
|
7
|
+
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.tsx
|
|
8
|
+
var l = ({ className: l, node: u, nodes: d }) => {
|
|
9
|
+
let [f, p] = a(u.id), m = i(() => c(d, `${f}`), [f, d]), h = r((e) => p(e), []);
|
|
10
|
+
return /* @__PURE__ */ s("div", {
|
|
11
|
+
className: n("flex", l),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ o(e, {
|
|
14
|
+
className: "grow basis-0",
|
|
15
|
+
nodeId: u.id,
|
|
16
|
+
nodes: d,
|
|
17
|
+
selected: f,
|
|
18
|
+
onSelect: h
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ o("div", { className: "mx-1 w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
|
|
21
|
+
f && /* @__PURE__ */ o("div", {
|
|
22
|
+
className: "flex min-w-0 grow basis-0",
|
|
23
|
+
children: /* @__PURE__ */ o(t, {
|
|
24
|
+
whenParams: m.whenParams,
|
|
25
|
+
status: m.status,
|
|
26
|
+
name: m.node.title,
|
|
27
|
+
startTime: m.startTime,
|
|
28
|
+
endTime: m.endTime,
|
|
29
|
+
when: m.node.when,
|
|
30
|
+
type: m.node.type,
|
|
31
|
+
action: m.node.action
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { l as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type BodyHeaderProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
triggerName: ReactNode;
|
|
5
|
+
startTime: number;
|
|
6
|
+
endTime: number;
|
|
7
|
+
duration?: string;
|
|
8
|
+
elementId?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const BodyHeader: ({ triggerName, startTime, endTime, duration, elementId }: BodyHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default BodyHeader;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useCallback as e, useMemo as t } from "react";
|
|
2
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { createStoreHook as i } from "@plitzi/sdk-store/createStore";
|
|
4
|
+
import { get as a } from "@plitzi/plitzi-ui/helpers";
|
|
5
|
+
import { formatDate as o } from "@plitzi/sdk-shared/helpers";
|
|
6
|
+
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.tsx
|
|
7
|
+
var s = ({ triggerName: s, startTime: c, endTime: l, duration: u, elementId: d }) => {
|
|
8
|
+
let { useStore: f } = i(), [p] = f("schema.flat"), m = t(() => d ? a(p, d) : void 0, [d, p]), h = t(() => o(c, "HH:mm:ss.SSS"), [c]), g = t(() => o(l, "HH:mm:ss.SSS"), [l]), _ = t(() => {
|
|
9
|
+
if (!(typeof document > "u")) return document.querySelector(`[data-id="${d}"]`);
|
|
10
|
+
}, [d]), v = e(() => {
|
|
11
|
+
_?.scrollIntoView({
|
|
12
|
+
behavior: "smooth",
|
|
13
|
+
block: "nearest",
|
|
14
|
+
inline: "nearest"
|
|
15
|
+
});
|
|
16
|
+
}, [_]), y = e(() => {
|
|
17
|
+
_?.classList.add("devtools-element-hovered");
|
|
18
|
+
}, [_]), b = e(() => {
|
|
19
|
+
_?.classList.remove("devtools-element-hovered");
|
|
20
|
+
}, [_]);
|
|
21
|
+
return /* @__PURE__ */ r("div", {
|
|
22
|
+
className: "flex justify-around gap-3",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ r("div", {
|
|
25
|
+
className: "flex min-w-0 grow basis-0 flex-col",
|
|
26
|
+
children: [/* @__PURE__ */ r("div", {
|
|
27
|
+
className: "mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
28
|
+
children: [/* @__PURE__ */ n("i", { className: "fa-regular fa-clock" }), "Times"]
|
|
29
|
+
}), /* @__PURE__ */ r("div", {
|
|
30
|
+
className: "flex flex-col gap-0.5 font-mono text-zinc-700 dark:text-zinc-300",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ r("div", {
|
|
33
|
+
className: "flex gap-1",
|
|
34
|
+
children: [/* @__PURE__ */ n("span", {
|
|
35
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
36
|
+
children: "Start"
|
|
37
|
+
}), h]
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ r("div", {
|
|
40
|
+
className: "flex gap-1",
|
|
41
|
+
children: [/* @__PURE__ */ n("span", {
|
|
42
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
43
|
+
children: "End"
|
|
44
|
+
}), g]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ r("div", {
|
|
47
|
+
className: "flex gap-1",
|
|
48
|
+
children: [/* @__PURE__ */ n("span", {
|
|
49
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
50
|
+
children: "Duration"
|
|
51
|
+
}), u]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
})]
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ n("div", { className: "w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
|
|
57
|
+
/* @__PURE__ */ r("div", {
|
|
58
|
+
className: "flex min-w-0 grow basis-0 flex-col",
|
|
59
|
+
children: [/* @__PURE__ */ r("div", {
|
|
60
|
+
className: "mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
61
|
+
children: [/* @__PURE__ */ n("i", { className: "fa-solid fa-circle-info" }), "Details"]
|
|
62
|
+
}), /* @__PURE__ */ r("div", {
|
|
63
|
+
className: "flex flex-col gap-0.5 text-zinc-700 dark:text-zinc-300",
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ r("div", {
|
|
66
|
+
className: "flex gap-1",
|
|
67
|
+
children: [/* @__PURE__ */ n("span", {
|
|
68
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
69
|
+
children: "Type"
|
|
70
|
+
}), /* @__PURE__ */ n("span", { children: "Interaction" })]
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ r("div", {
|
|
73
|
+
className: "flex min-w-0 gap-1",
|
|
74
|
+
children: [/* @__PURE__ */ n("span", {
|
|
75
|
+
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
76
|
+
children: "Trigger"
|
|
77
|
+
}), /* @__PURE__ */ n("span", {
|
|
78
|
+
className: "truncate",
|
|
79
|
+
children: s
|
|
80
|
+
})]
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ r("div", {
|
|
83
|
+
className: "flex min-w-0 gap-1",
|
|
84
|
+
children: [/* @__PURE__ */ n("span", {
|
|
85
|
+
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
86
|
+
children: "Element"
|
|
87
|
+
}), /* @__PURE__ */ r("span", {
|
|
88
|
+
className: "cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",
|
|
89
|
+
onClick: v,
|
|
90
|
+
onMouseEnter: y,
|
|
91
|
+
onMouseLeave: b,
|
|
92
|
+
children: [m?.definition.label, d && /* @__PURE__ */ r("span", {
|
|
93
|
+
className: "ml-1 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",
|
|
94
|
+
children: [
|
|
95
|
+
"[",
|
|
96
|
+
d,
|
|
97
|
+
"]"
|
|
98
|
+
]
|
|
99
|
+
})]
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
export { s as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LogInteraction } from '@plitzi/sdk-shared';
|
|
2
|
+
type Nodes = LogInteraction['params']['nodes'];
|
|
3
|
+
export type ExecutionTreeProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
nodeId: string;
|
|
6
|
+
selected?: string;
|
|
7
|
+
nodes: Nodes;
|
|
8
|
+
onSelect?: (id?: string) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const ExecutionTree: ({ className, nodeId, nodes, selected, onSelect }: ExecutionTreeProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default ExecutionTree;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import e from "./ExecutionTreeNode.mjs";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { useCallback as n, useMemo as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { get as o } from "@plitzi/plitzi-ui/helpers";
|
|
6
|
+
import { getDurationMs as s } from "@plitzi/sdk-shared";
|
|
7
|
+
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.tsx
|
|
8
|
+
var c = ({ className: c, nodeId: l, nodes: u, selected: d, onSelect: f }) => {
|
|
9
|
+
let p = r(() => {
|
|
10
|
+
let e = o(u, l), t = [];
|
|
11
|
+
for (; e;) {
|
|
12
|
+
let { node: n, startTime: r, endTime: i } = e, a = `${s(r, i)}ms`, c = n.id === l ? 0 : 1;
|
|
13
|
+
t.push({
|
|
14
|
+
id: n.id,
|
|
15
|
+
action: n.action,
|
|
16
|
+
title: n.title,
|
|
17
|
+
status: e.status,
|
|
18
|
+
level: c,
|
|
19
|
+
duration: a
|
|
20
|
+
}), e = o(u, n.afterNode);
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
}, [l, u]), m = n((e) => f?.(e), [f]);
|
|
24
|
+
return /* @__PURE__ */ a("div", {
|
|
25
|
+
className: t("flex flex-col gap-1.5", c),
|
|
26
|
+
children: [/* @__PURE__ */ a("div", {
|
|
27
|
+
className: "flex items-center gap-1.5 px-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
28
|
+
children: [/* @__PURE__ */ i("i", { className: "fa-solid fa-code-merge" }), "Execution Tree"]
|
|
29
|
+
}), /* @__PURE__ */ i("div", {
|
|
30
|
+
className: "flex flex-col",
|
|
31
|
+
children: p.map((t, n) => /* @__PURE__ */ i(e, {
|
|
32
|
+
id: t.id,
|
|
33
|
+
action: t.action,
|
|
34
|
+
title: t.title,
|
|
35
|
+
duration: t.duration,
|
|
36
|
+
status: t.status,
|
|
37
|
+
level: t.level,
|
|
38
|
+
isSelected: t.id === d,
|
|
39
|
+
onClick: m
|
|
40
|
+
}, n))
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { c as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InteractionNodeStatus } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ExecutionTreeNodeProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
action?: string;
|
|
5
|
+
title: string;
|
|
6
|
+
duration: string;
|
|
7
|
+
level: number;
|
|
8
|
+
isSelected?: boolean;
|
|
9
|
+
status?: InteractionNodeStatus;
|
|
10
|
+
onClick: (id: string) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const ExecutionTreeNode: ({ title, action, duration, status, level, id, isSelected, onClick }: ExecutionTreeNodeProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default ExecutionTreeNode;
|