Skip to content

Commit 4ed4e95

Browse files
committed
Refactor imports to use relative paths in components
Replaced all '@/ui' and '@/lib/utils' imports with relative paths (e.g., '../../ui', '../lib/utils') across component renderer and UI files. Updated example app to register components and improved Vite config with additional path aliases for local development. These changes improve compatibility with monorepo setups and ensure correct module resolution.
1 parent a7c3608 commit 4ed4e95

File tree

110 files changed

+159
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+159
-151
lines changed

examples/designer-modes/src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ import type { SchemaNode } from '@object-ui/core';
55
function App() {
66
const [mode, setMode] = useState<DesignerMode>('general');
77
const [schema, setSchema] = useState<SchemaNode>({
8+
id: 'root',
89
type: 'div',
9-
className: 'p-8',
10+
className: 'p-8 min-h-[400px] border-2 border-dashed border-gray-200 rounded-lg',
1011
body: []
1112
});
1213

1314
return (
1415
<div className="h-screen flex flex-col">
1516
{/* Mode Selector */}
1617
<div className="h-16 bg-gray-900 text-white flex items-center px-6 gap-4 shadow-lg z-50">
17-
<h1 className="text-xl font-bold">Object UI Designer Modes</h1>
18+
<h1 className="text-xl font-bold">Object UI Designer</h1>
1819
<div className="flex-1" />
1920
<div className="flex gap-2">
2021
<button

examples/designer-modes/src/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { StrictMode } from 'react';
22
import { createRoot } from 'react-dom/client';
3+
import '@object-ui/components'; // Register components
34
import App from './App';
45
import './index.css';
56

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react';
3+
import path from 'path';
34

45
// https://vitejs.dev/config/
56
export default defineConfig({
67
plugins: [react()],
78
resolve: {
89
alias: {
910
'@': '/src',
11+
'@object-ui/core': path.resolve(__dirname, '../../packages/core/src'),
12+
'@object-ui/types': path.resolve(__dirname, '../../packages/types/src'),
13+
'@object-ui/components': path.resolve(__dirname, '../../packages/components/src'),
14+
'@object-ui/designer': path.resolve(__dirname, '../../packages/designer/src'),
15+
'@object-ui/react': path.resolve(__dirname, '../../packages/react/src'),
1016
},
1117
},
1218
});

packages/components/src/renderers/basic/html.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { ComponentRegistry } from '@object-ui/core';
33
import type { HtmlSchema } from '@object-ui/types';
4-
import { cn } from '@/lib/utils';
4+
import { cn } from '../../lib/utils';
55

66
ComponentRegistry.register('html',
77
({ schema, className, ...props }: { schema: HtmlSchema; className?: string; [key: string]: any }) => {

packages/components/src/renderers/basic/separator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentRegistry } from '@object-ui/core';
22
import type { SeparatorSchema } from '@object-ui/types';
3-
import { Separator } from '@/ui';
3+
import { Separator } from '../../ui';
44

55
ComponentRegistry.register('separator',
66
({ schema, className, ...props }: { schema: SeparatorSchema; className?: string; [key: string]: any }) => {

packages/components/src/renderers/complex/calendar-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentRegistry } from '@object-ui/core';
22
import type { CalendarViewSchema, CalendarEvent } from '@object-ui/types';
3-
import { CalendarView } from '@/ui';
3+
import { CalendarView } from '../../ui';
44
import React from 'react';
55

66
// Calendar View Renderer - Airtable-style calendar for displaying records as events

packages/components/src/renderers/complex/carousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
CarouselItem,
77
CarouselPrevious,
88
CarouselNext
9-
} from '@/ui';
9+
} from '../../ui';
1010
import { renderChildren } from '../../lib/utils';
1111

1212
ComponentRegistry.register('carousel',

packages/components/src/renderers/complex/chatbot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentRegistry } from '@object-ui/core';
22
import type { ChatbotSchema, ChatMessage } from '@object-ui/types';
3-
import { Chatbot } from '@/ui';
3+
import { Chatbot } from '../../ui';
44
import { useState } from 'react';
55

66
/**

packages/components/src/renderers/complex/data-table.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ import {
1111
TableRow,
1212
TableCell,
1313
TableCaption
14-
} from '@/ui/table';
15-
import { Button } from '@/ui/button';
16-
import { Input } from '@/ui/input';
17-
import { Checkbox } from '@/ui/checkbox';
14+
} from '../../ui/table';
15+
import { Button } from '../../ui/button';
16+
import { Input } from '../../ui/input';
17+
import { Checkbox } from '../../ui/checkbox';
1818
import {
1919
Select,
2020
SelectContent,
2121
SelectItem,
2222
SelectTrigger,
2323
SelectValue,
24-
} from '@/ui/select';
24+
} from '../../ui/select';
2525
import {
2626
ChevronUp,
2727
ChevronDown,

packages/components/src/renderers/complex/filter-builder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentRegistry } from '@object-ui/core';
22
import type { FilterBuilderSchema, FilterGroup } from '@object-ui/types';
3-
import { FilterBuilder } from '@/ui/filter-builder';
3+
import { FilterBuilder } from '../../ui/filter-builder';
44

55
ComponentRegistry.register('filter-builder',
66
({ schema, className, onChange, ...props }: { schema: FilterBuilderSchema; className?: string; onChange?: (event: any) => void; [key: string]: any }) => {

0 commit comments

Comments
 (0)