@motiadev/workbench 0.4.2-beta.95 → 0.4.4-beta.97
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/src/components/endpoints/endpoint-body-panel.js +1 -1
- package/dist/src/components/endpoints/endpoint-path-params-panel.d.ts +1 -1
- package/dist/src/components/endpoints/endpoint-path-params-panel.js +2 -13
- package/dist/src/components/endpoints/hooks/utils.d.ts +1 -1
- package/dist/src/components/endpoints/json-editor.d.ts +1 -1
- package/dist/src/components/endpoints/json-editor.js +10 -8
- package/dist/src/components/observability/trace-item/trace-item.js +1 -1
- package/dist/src/components/observability/trace-timeline.js +1 -1
- package/dist/src/components/sidebar/sidebar.js +1 -1
- package/dist/src/components/states/state-details.d.ts +7 -0
- package/dist/src/components/states/state-details.js +34 -0
- package/dist/src/components/states/state-editor.d.ts +7 -0
- package/dist/src/components/states/state-editor.js +62 -0
- package/dist/src/components/states/{state-detail.d.ts → state-sidebar.d.ts} +1 -1
- package/dist/src/components/states/state-sidebar.js +17 -0
- package/dist/src/components/states/states-page.js +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/components/states/state-detail.js +0 -18
- package/dist/src/components/states/state-value.d.ts +0 -8
- package/dist/src/components/states/state-value.js +0 -51
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motiadev/workbench",
|
|
3
3
|
"description": "A web-based interface for building and managing Motia workflows.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4-beta.97",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@monaco-editor/react": "^4.6.1",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"typescript": "~5.8.3",
|
|
41
41
|
"typescript-eslint": "^8.32.1",
|
|
42
42
|
"vite": "^6.3.5",
|
|
43
|
-
"@motiadev/stream-client-react": "0.4.
|
|
44
|
-
"@motiadev/ui": "0.4.
|
|
43
|
+
"@motiadev/stream-client-react": "0.4.4-beta.97",
|
|
44
|
+
"@motiadev/ui": "0.4.4-beta.97"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Sidebar } from '@/components/sidebar/sidebar';
|
|
3
|
-
import { Braces, X } from 'lucide-react';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import JsonView from 'react18-json-view';
|
|
6
|
-
import { StateValue } from './state-value';
|
|
7
|
-
export const StateDetail = ({ state, onClose }) => {
|
|
8
|
-
const [isCodeEnabled, setIsCodeEnabled] = useState(false);
|
|
9
|
-
return (_jsx(Sidebar, { onClose: onClose, title: "State details", subtitle: `${state.groupId} ${state.key}`, actions: [
|
|
10
|
-
{
|
|
11
|
-
active: isCodeEnabled,
|
|
12
|
-
icon: _jsx(Braces, {}),
|
|
13
|
-
onClick: () => setIsCodeEnabled(!isCodeEnabled),
|
|
14
|
-
label: 'Code',
|
|
15
|
-
},
|
|
16
|
-
{ icon: _jsx(X, {}), onClick: onClose, label: 'Close' },
|
|
17
|
-
], children: _jsx("div", { className: "flex flex-col gap-2", children: isCodeEnabled ? _jsx(JsonView, { src: state.value }) : _jsx(StateValue, { value: state.value, isRoot: true }) }) }));
|
|
18
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
import { cva } from 'class-variance-authority';
|
|
4
|
-
import { SquareMinus, SquarePlus } from 'lucide-react';
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
const valueVariants = cva('text-muted-foreground text-sm', {
|
|
7
|
-
variants: {
|
|
8
|
-
variant: {
|
|
9
|
-
boolean: 'text-sky-400 font-mono font-bold',
|
|
10
|
-
number: 'text-teal-400 font-mono font-bold',
|
|
11
|
-
undefined: 'text-muted-foreground',
|
|
12
|
-
string: 'text-muted-foreground font-mono font-medium',
|
|
13
|
-
object: 'text-gray-800',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
variant: 'string',
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
const Value = ({ value, variant, label, }) => {
|
|
21
|
-
const displayValue = typeof value === 'string' ? value : JSON.stringify(value);
|
|
22
|
-
return (_jsxs("div", { className: "flex flex-col gap-1", children: [label && _jsx("div", { className: "text-md font-bold", children: label }), _jsx("div", { className: valueVariants({ variant }), children: displayValue })] }));
|
|
23
|
-
};
|
|
24
|
-
export const StateValue = ({ value, label, isRoot = false }) => {
|
|
25
|
-
const [isOpen, setIsOpen] = useState(true);
|
|
26
|
-
const toggle = () => setIsOpen(!isOpen);
|
|
27
|
-
if (React.isValidElement(value)) {
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
if (typeof value === 'boolean') {
|
|
31
|
-
return _jsx(Value, { label: label, variant: "boolean", value: value ? 'true' : 'false' });
|
|
32
|
-
}
|
|
33
|
-
if (typeof value === 'number') {
|
|
34
|
-
return _jsx(Value, { label: label, variant: "number", value: value });
|
|
35
|
-
}
|
|
36
|
-
if (typeof value === 'undefined') {
|
|
37
|
-
return _jsx(Value, { label: label, variant: "undefined", value: value });
|
|
38
|
-
}
|
|
39
|
-
if (typeof value === 'string') {
|
|
40
|
-
return _jsx(Value, { label: label, variant: "string", value: value });
|
|
41
|
-
}
|
|
42
|
-
const isArray = Array.isArray(value);
|
|
43
|
-
const [openBracket, closeBracket] = isRoot ? [] : isArray ? ['[', ']'] : ['{', '}'];
|
|
44
|
-
if (typeof value === 'object' && !!value) {
|
|
45
|
-
const valueObject = value;
|
|
46
|
-
return (_jsxs("div", { className: "flex flex-col gap-2", children: [(label || openBracket) && (_jsxs("div", { className: "flex gap-1 items-center text-md font-bold hover:bg-muted-foreground/10 rounded-md py-2 cursor-pointer", onClick: toggle, children: [isOpen ? (_jsx(SquareMinus, { className: "w-4 h-4 text-muted-foreground" })) : (_jsx(SquarePlus, { className: "w-4 h-4 text-muted-foreground" })), label, ' ', !isRoot && (_jsxs("span", { className: "text-muted-foreground text-sm", children: [openBracket, !isOpen && ` ... ${closeBracket}`] }))] })), isOpen &&
|
|
47
|
-
!!valueObject &&
|
|
48
|
-
Object.keys(valueObject).map((key) => (_jsx("div", { className: cn('flex flex-col gap-2', !isRoot && 'ml-4'), children: _jsx("span", { className: "text-md", children: _jsx(StateValue, { label: isArray ? undefined : key, value: valueObject[key] }) }) }, key))), !isRoot && isOpen && _jsx("span", { className: "text-muted-foreground text-sm", children: closeBracket })] }));
|
|
49
|
-
}
|
|
50
|
-
return _jsx(Value, { value: undefined, variant: "object" });
|
|
51
|
-
};
|