@motiadev/workbench 0.9.4-beta.151-160668 → 0.9.4-beta.151-182295

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.
@@ -27,7 +27,7 @@ const WorkbenchPluginSchema = zod_1.z.object({
27
27
  label: zod_1.z.string().optional(),
28
28
  labelIcon: zod_1.z.string().optional(),
29
29
  cssImports: zod_1.z.array(zod_1.z.string()).optional(),
30
- props: zod_1.z.record(zod_1.z.any(), zod_1.z.any()).optional(),
30
+ props: zod_1.z.record(zod_1.z.any()).optional(),
31
31
  });
32
32
  /**
33
33
  * Validates a single plugin configuration.
@@ -49,7 +49,7 @@ function validatePluginConfig(plugin, index) {
49
49
  try {
50
50
  const result = WorkbenchPluginSchema.safeParse(plugin);
51
51
  if (!result.success) {
52
- result.error.issues.forEach((err) => {
52
+ result.error.errors.forEach((err) => {
53
53
  const path = err.path.join('.');
54
54
  errors.push(`Plugin at index ${index}, field "${path}": ${err.message}`);
55
55
  });
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CollapsiblePanel, TabsContent, TabsList, TabsTrigger } from '@motiadev/ui';
3
- import { memo, useId } from 'react';
3
+ import { memo } from 'react';
4
4
  import { useShallow } from 'zustand/react/shallow';
5
5
  import { TabLocation, useAppTabsStore } from '../stores/use-app-tabs-store';
6
6
  import { useTabsStore } from '../stores/use-tabs-store';
7
7
  const bottomTabsSelector = (state) => state.tabs[TabLocation.BOTTOM];
8
+ const bottomPanelId = 'bottom-panel';
8
9
  export const BottomPanel = memo(() => {
9
10
  const defaultTab = useTabsStore((state) => state.tab.bottom);
10
11
  const setBottomTab = useTabsStore((state) => state.setBottomTab);
11
12
  const tabs = useAppTabsStore(useShallow(bottomTabsSelector));
12
- const bottomPanelId = useId();
13
13
  return (_jsx(CollapsiblePanel, { id: bottomPanelId, variant: 'tabs', defaultTab: defaultTab, onTabChange: setBottomTab, header: _jsx(TabsList, { children: tabs.map(({ id, tabLabel: Label }) => (_jsx(TabsTrigger, { value: id, "data-testid": `${id.toLowerCase()}-link`, className: "cursor-pointer", children: _jsx(Label, {}) }, id))) }), children: tabs.map(({ id, content: Element }) => (_jsx(TabsContent, { value: id, className: "h-full", children: _jsx(Element, {}) }, id))) }));
14
14
  });
15
15
  BottomPanel.displayName = 'BottomPanel';
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CollapsiblePanel, TabsContent, TabsList, TabsTrigger } from '@motiadev/ui';
3
- import { memo, useId } from 'react';
3
+ import { memo } from 'react';
4
4
  import { useShallow } from 'zustand/react/shallow';
5
5
  import { TabLocation, useAppTabsStore } from '../stores/use-app-tabs-store';
6
6
  import { useTabsStore } from '../stores/use-tabs-store';
7
7
  const topTabsSelector = (state) => state.tabs[TabLocation.TOP];
8
+ const topPanelId = 'top-panel';
8
9
  export const TopPanel = memo(() => {
9
10
  const defaultTab = useTabsStore((state) => state.tab.top);
10
11
  const setTopTab = useTabsStore((state) => state.setTopTab);
11
12
  const tabs = useAppTabsStore(useShallow(topTabsSelector));
12
- const topPanelId = useId();
13
13
  return (_jsx(CollapsiblePanel, { id: topPanelId, variant: 'tabs', defaultTab: defaultTab, onTabChange: setTopTab, withResizeHandle: true, header: _jsx(TabsList, { children: tabs.map(({ id, tabLabel: Label }) => (_jsx(TabsTrigger, { value: id, "data-testid": `${id.toLowerCase()}-link`, className: "cursor-pointer", children: _jsx(Label, {}) }, id))) }), children: tabs.map(({ id, content: Element }) => (_jsx(TabsContent, { value: id, className: "h-full", children: _jsx(Element, {}) }, id))) }));
14
14
  });
15
15
  TopPanel.displayName = 'TopPanel';
@@ -21,7 +21,7 @@ export const workbenchXPath = {
21
21
  playButton: '//button[@data-testid="endpoint-play-button"]',
22
22
  },
23
23
  tracing: {
24
- trace: (index) => `(//div[contains(@class, 'motia-trace-group')])[${index}]`,
24
+ trace: (index) => `(//button[contains(@class, 'motia-trace-group')])[${index}]`,
25
25
  details: '//div[@data-testid="trace-details"]',
26
26
  timeline: (index) => `(//div[@data-testid="trace-timeline-item"])[${index}]`,
27
27
  },
@@ -38,7 +38,7 @@ export const workbenchXPath = {
38
38
  links: {
39
39
  flows: '//div[@data-testid="flows-dropdown-trigger"]',
40
40
  endpoints: '//button[@data-testid="endpoints-link"]',
41
- tracing: '//button[@data-testid="traces-link"]',
41
+ tracing: '//button[@data-testid="tracing-link"]',
42
42
  logs: '//button[@data-testid="logs-link"]',
43
43
  states: '//button[@data-testid="states-link"]',
44
44
  },
@@ -127,6 +127,7 @@ export const useTutorialEngine = () => {
127
127
  setTimeout(() => {
128
128
  if (ref.current?.parentElement) {
129
129
  ref.current.parentElement.style.display = 'none';
130
+ setCurrentStep(0);
130
131
  }
131
132
  }, 300);
132
133
  }
@@ -4,16 +4,16 @@ import { forwardRef, useEffect } from 'react';
4
4
  export const TutorialStep = forwardRef(({ step, totalSteps, title, description, link, image, onNext, onClose }, ref) => {
5
5
  useEffect(() => {
6
6
  const handleKeyDown = (e) => {
7
- if (e.key === 'Escape') {
7
+ if (step > 0 && e.key === 'Escape') {
8
8
  onClose();
9
9
  }
10
- else if (e.key === 'ArrowRight') {
10
+ else if (step > 0 && e.key === 'ArrowRight') {
11
11
  onNext();
12
12
  }
13
13
  };
14
14
  window.addEventListener('keydown', handleKeyDown);
15
15
  return () => window.removeEventListener('keydown', handleKeyDown);
16
- }, [onClose, onNext]);
16
+ }, [onClose, onNext, step]);
17
17
  return (_jsxs("div", { ref: ref, className: "driver-popover ", children: [image && (_jsx("img", { src: image.src, alt: "Step visual", className: "driver-popover-image object-cover", style: { height: image.height, width: '100%' } })), _jsxs("div", { className: "isolate relative", children: [_jsx(BackgroundEffect, {}), _jsx("div", { className: "driver-popover-title", children: _jsx("h2", { className: "popover-title", children: title }) }), _jsx("div", { className: "driver-popover-description", children: description }), link && (_jsx("a", { href: link, target: "_blank", className: "text-foreground text-xs font-semibold px-4 hover:underline", children: "Learn more" })), _jsxs("div", { className: "driver-popover-footer flex items-center justify-between", children: [_jsxs("div", { className: "text-sm text-muted-foreground font-semibold", children: [step, " ", _jsx("span", { className: "text-foreground", children: "/" }), " ", totalSteps] }), _jsx("div", { className: "driver-popover-navigation-btns driver-popover-navigation-btns-hint flex gap-2", children: _jsx("button", { className: "driver-popover-next-btn", onClick: onNext, children: step < totalSteps ? 'Continue' : 'Finish' }) })] }), step < totalSteps && (_jsx("div", { className: "tutorial-opt-out-container", children: _jsx("button", { className: "tutorial-opt-out-button", onClick: onClose, children: "Close" }) }))] })] }));
18
18
  });
19
19
  TutorialStep.displayName = 'TutorialStep';