@motiadev/workbench 0.8.4-beta.142-001319 → 0.8.5-beta.142

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.
@@ -58,6 +58,7 @@ const applyMiddleware = async ({ app, port, workbenchBase, plugins }) => {
58
58
  allow: [
59
59
  __dirname, // workbench root
60
60
  path_1.default.join(process.cwd(), './steps'), // steps directory
61
+ path_1.default.join(process.cwd(), './src'), // src directory
61
62
  path_1.default.join(process.cwd(), './tutorial.tsx'), // tutorial file
62
63
  path_1.default.join(process.cwd(), './node_modules'), // node_modules directory
63
64
  path_1.default.join(__dirname, './node_modules'), // node_modules directory
@@ -3,7 +3,7 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
3
3
  import { ChevronsUpDown, Workflow } from 'lucide-react';
4
4
  import { useShallow } from 'zustand/react/shallow';
5
5
  import { useFetchFlows } from '@/hooks/use-fetch-flows';
6
- import { analytics } from '@/lib/analytics';
6
+ import { motiaAnalytics } from '@/lib/motia-analytics';
7
7
  import { useFlowStore } from '@/stores/use-flow-store';
8
8
  export const FlowTabMenuItem = () => {
9
9
  useFetchFlows();
@@ -15,7 +15,7 @@ export const FlowTabMenuItem = () => {
15
15
  }
16
16
  const handleFlowSelect = (flowId) => {
17
17
  selectFlowId(flowId);
18
- analytics.track('flow_selected', { flow: flowId });
18
+ motiaAnalytics.track('flow_selected', { flow: flowId });
19
19
  };
20
20
  return (_jsxs("div", { className: "flex flex-row justify-center items-center gap-2 cursor-pointer", children: [_jsx(Workflow, {}), selectedFlowId ?? 'No flow selected', _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("div", { "data-testid": "flows-dropdown-trigger", className: "flex flex-row justify-center items-center gap-2 cursor-pointer", children: _jsx(ChevronsUpDown, { className: "size-4" }) }) }), _jsx(DropdownMenuContent, { className: "bg-background text-foreground flows-dropdown", children: flows.map((item) => (_jsx(DropdownMenuItem, { "data-testid": `dropdown-${item}`, className: "cursor-pointer gap-2 flow-link", onClick: () => handleFlowSelect(item), children: item }, `dropdown-${item}`))) })] })] }));
21
21
  };
@@ -2,26 +2,26 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@motiadev/ui';
3
3
  import { Rocket } from 'lucide-react';
4
4
  import { useState } from 'react';
5
- import { analytics } from '@/lib/analytics';
5
+ import { motiaAnalytics } from '@/lib/motia-analytics';
6
6
  export const DeployButton = () => {
7
7
  const [isOpen, setIsOpen] = useState(false);
8
8
  const onDeployButtonClick = () => {
9
- analytics.track('deploy_button_clicked');
9
+ motiaAnalytics.track('deploy_button_clicked');
10
10
  };
11
11
  const onDeployClick = () => {
12
12
  setIsOpen(false);
13
- analytics.track('deploy_button_deploy_clicked');
13
+ motiaAnalytics.track('deploy_button_deploy_clicked');
14
14
  };
15
15
  const onClose = () => {
16
16
  setIsOpen(false);
17
- analytics.track('deploy_button_closed');
17
+ motiaAnalytics.track('deploy_button_closed');
18
18
  };
19
19
  const onMotiaCloudClick = () => {
20
20
  setIsOpen(true);
21
- analytics.track('deploy_button_motia_cloud_clicked');
21
+ motiaAnalytics.track('deploy_button_motia_cloud_clicked');
22
22
  };
23
23
  const onSelfHostedClick = () => {
24
- analytics.track('deploy_button_self_hosted_clicked');
24
+ motiaAnalytics.track('deploy_button_self_hosted_clicked');
25
25
  window.open('https://www.motia.dev/docs/deployment-guide/self-hosted', '_blank');
26
26
  };
27
27
  return (_jsxs(_Fragment, { children: [isOpen && (_jsxs("div", { children: [_jsx("div", { className: "fixed inset-0 z-[9999] bg-black/20 backdrop-blur-sm", onClick: () => setIsOpen(false) }), _jsxs("div", { className: "driver-popover w-[600px]! fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[10000] animate-in fade-in-0 zoom-in-95", children: [_jsx("img", { src: "https://oxhhfuuoqzsaqthfairn.supabase.co/storage/v1/object/public/public-images/preview.png", alt: "Motia Cloud", className: "driver-popover-image object-cover", style: { height: 393, width: '100%' } }), _jsx("div", { className: "driver-popover-title", children: _jsx("h2", { className: "popover-title", children: "Motia Cloud is Live!" }) }), _jsx("div", { className: "driver-popover-description", children: "Deploy to production in minutes, not hours. One click gets your Motia project live with enterprise-grade reliability. Seamlessly scale, rollback instantly, and monitor everything in real-time. Your code deserves infrastructure that just works." }), _jsx("a", { href: "https://www.motia.dev/docs/concepts/deployment/motia-cloud/features", target: "_blank", className: "text-foreground text-xs font-semibold px-4 hover:underline", rel: "noopener", children: "Learn more about Motia Cloud" }), _jsx("div", { className: "driver-popover-footer flex items-center justify-end", children: _jsxs("div", { className: "driver-popover-navigation-btns flex gap-6", children: [_jsx("button", { className: "tutorial-opt-out-button text-sm! font-semibold! text-muted-foreground!", onClick: onClose, children: "Close" }), _jsx("a", { href: "https://motia.cloud?utm_source=workbench&utm_medium=referral", target: "_blank", onClick: onDeployClick, rel: "noopener", children: _jsx("button", { className: "driver-popover-next-btn", children: "Deploy!" }) })] }) })] })] })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: "font-semibold text-sm dark:bg-white dark:text-black dark:hover:bg-white/90 bg-black/90 hover:bg-black/80 text-white", onClick: onDeployButtonClick, children: [_jsx(Rocket, {}), "Deploy"] }) }), _jsxs(DropdownMenuContent, { className: "bg-background text-foreground w-56", children: [_jsx(DropdownMenuItem, { className: "cursor-pointer h-10 font-semibold", onClick: onMotiaCloudClick, children: "Motia Cloud" }), _jsx(DropdownMenuItem, { className: "cursor-pointer h-10 font-semibold", onClick: onSelfHostedClick, children: "Self-Hosted (Docker)" })] })] })] }));
@@ -1,4 +1,4 @@
1
- import { useAnalytics } from '@/lib/analytics';
1
+ import { useAnalytics } from '@/lib/motia-analytics';
2
2
  export const RootMotia = ({ children }) => {
3
3
  useAnalytics();
4
4
  return children;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button } from '@motiadev/ui';
3
3
  import { Book } from 'lucide-react';
4
- import { analytics } from '@/lib/analytics';
4
+ import { motiaAnalytics } from '@/lib/motia-analytics';
5
5
  import { Tooltip } from '../ui/tooltip';
6
6
  import { useTutorial } from './hooks/use-tutorial';
7
7
  export const TutorialButton = () => {
@@ -11,7 +11,7 @@ export const TutorialButton = () => {
11
11
  if (!isTutorialFlowMissing) {
12
12
  open();
13
13
  }
14
- analytics.track('tutorial_button_clicked', { isTutorialFlowMissing });
14
+ motiaAnalytics.track('tutorial_button_clicked', { isTutorialFlowMissing });
15
15
  };
16
16
  const trigger = (_jsxs(Button, { "data-testid": "tutorial-trigger", variant: "default", onClick: () => onTutorialButtonClick(), children: [_jsx(Book, { className: "h-4 w-4" }), "Tutorial"] }));
17
17
  if (isTutorialFlowMissing) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { analytics } from '@/lib/analytics';
2
+ import { motiaAnalytics } from '@/lib/motia-analytics';
3
3
  import { useTutorialEngine } from './hooks/use-tutorial-engine';
4
4
  import { TutorialStep } from './tutorial-step';
5
5
  import './tutorial.css';
@@ -10,19 +10,19 @@ export const Tutorial = () => {
10
10
  const nextStep = currentStep + 1;
11
11
  engine.moveStep(nextStep);
12
12
  if (engine.currentStep === engine.totalSteps) {
13
- analytics.track('tutorial_completed', {
13
+ motiaAnalytics.track('tutorial_completed', {
14
14
  manualOpen: engine.manualOpenRef.current,
15
15
  });
16
16
  }
17
17
  else {
18
- analytics.track('tutorial_next_step', {
18
+ motiaAnalytics.track('tutorial_next_step', {
19
19
  step: nextStep,
20
20
  manualOpen: engine.manualOpenRef.current,
21
21
  });
22
22
  }
23
23
  };
24
24
  const onClose = () => {
25
- analytics.track('tutorial_closed', {
25
+ motiaAnalytics.track('tutorial_closed', {
26
26
  step: engine.currentStepRef.current,
27
27
  manualOpen: engine.manualOpenRef.current,
28
28
  });
@@ -27,7 +27,7 @@ declare class WorkbenchAnalytics {
27
27
  };
28
28
  track(eventName: string, properties?: Record<string, any>): void;
29
29
  }
30
- export declare const analytics: WorkbenchAnalytics;
30
+ export declare const motiaAnalytics: WorkbenchAnalytics;
31
31
  export declare const useAnalytics: () => {
32
32
  track: (eventName: string, properties?: Record<string, any>) => void;
33
33
  getAnalyticsIds: () => {
@@ -117,13 +117,13 @@ class WorkbenchAnalytics {
117
117
  }
118
118
  }
119
119
  }
120
- export const analytics = new WorkbenchAnalytics();
120
+ export const motiaAnalytics = new WorkbenchAnalytics();
121
121
  export const useAnalytics = () => {
122
122
  const track = useCallback((eventName, properties) => {
123
- analytics.track(eventName, properties);
123
+ motiaAnalytics.track(eventName, properties);
124
124
  }, []);
125
125
  const getAnalyticsIds = useCallback(() => {
126
- return analytics.getAnalyticsIds();
126
+ return motiaAnalytics.getAnalyticsIds();
127
127
  }, []);
128
128
  return {
129
129
  track,
@@ -3,7 +3,7 @@ import { APP_SIDEBAR_CONTAINER_ID, CollapsiblePanel, CollapsiblePanelGroup, Tabs
3
3
  import { useCallback, useMemo } from 'react';
4
4
  import { useShallow } from 'zustand/react/shallow';
5
5
  import { Header } from './components/header/header';
6
- import { analytics } from './lib/analytics';
6
+ import { motiaAnalytics } from './lib/motia-analytics';
7
7
  import { TabLocation, useAppTabsStore } from './stores/use-app-tabs-store';
8
8
  import { useTabsStore } from './stores/use-tabs-store';
9
9
  const topTabs = (state) => state.tabs;
@@ -17,7 +17,7 @@ export const SystemViewMode = () => {
17
17
  [TabLocation.BOTTOM]: setBottomTab,
18
18
  }), [setTopTab, setBottomTab]);
19
19
  const onTabChange = useCallback((location) => (newTab) => {
20
- analytics.track(`${location} tab changed`, { [`new.${location}`]: newTab, tab });
20
+ motiaAnalytics.track(`${location} tab changed`, { [`new.${location}`]: newTab, tab });
21
21
  tabChangeCallbacks[location](newTab);
22
22
  }, [tabChangeCallbacks, tab]);
23
23
  return (_jsxs("div", { className: "grid grid-rows-[auto_1fr] grid-cols-[1fr_auto] bg-background text-foreground h-screen", children: [_jsx("div", { className: "col-span-2", children: _jsx(Header, {}) }), _jsx("main", { className: "m-2 overflow-hidden", role: "main", children: _jsxs(CollapsiblePanelGroup, { autoSaveId: "app-panel", direction: "vertical", className: "gap-1 h-full", "aria-label": "Workbench panels", children: [_jsx(CollapsiblePanel, { id: "top-panel", variant: 'tabs', defaultTab: tab.top, onTabChange: onTabChange(TabLocation.TOP), header: _jsx(TabsList, { children: tabs[TabLocation.TOP].map((tab) => {